Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Displaying markdown file in my Phalcon project

Hello everyone,

I am wondering how to include markdown file in my phalcon project.

Basically, if I have the following helloWorld.md in my public/mardown/ folder:

Hello World
====

Hello World Content

I would like to diplay this content (with a markdown rendering) within a random view... let's say app/views/index.volt. I guess this must be really trivial, but i have to admit that I am quite lost in the documentation.

Thank you in advance



9.7k

Hi, you can use extensions, just search on google or packagist, eg: https://packagist.org/packages/michelf/php-markdown



50.6k
Accepted
answer

You need to register a new view engine for markdown files. There's one already built, though the site's in Japanese - the code shouldn't be. http://hiden.samurai-factory.jp/php/phalcon%5markdown/

You can register multiple view engines, so I'd suggest just using this new engine on .md files, so you can still have the option of using Volt for .volt files.



1.1k
edited Jun '14

@quasipickle @Sum Thank you for both your answer, I found the packagist website well documented and I am currently studying it. Also, I select quasipickle anser as the good one since it is directly answering the question (although both answer really suited to my question)

EDIT: @Sum Sorry, I accepted really late, the fact is at this moment the server told me I had not enough reputation for accepting... See you soon on this forum for sure (I plan to spend more and more time on my own server as soon as possible, phalcon is really amazing, even for beginner).



9.7k

U can accept the answer then :-)