[Codeigniter] use markdown as library
2013-12-16 00:00
1 minute read

https://github.com/erusev/parsedown

download the Parsedown.php and put it into Library folder then edit autoload.php

$autoload['libraries'] = array('Parsedown');

then in the view php for tests:

$text = 'Hello **Parsedown**!';
$result = Parsedown::instance()->parse($text);
echo $result;

No need to require or include the file. If you want to load a file with path, you can use the function called file_get_contents:

file_get_contents('./markdown/test.md',true); (true: enable path)

Back to posts


comments powered by Disqus