-
Notifications
You must be signed in to change notification settings - Fork 26
PHP Markdown for CI 1.5.x
[em]Correction: Ignore the below unless you really need Markdown to be a library for some reason. Much easier to make it a helper - just put the original markdown.php, with no changes, into your system/helpers or application/helpers directory as markdown_helper.php. Then $this->load->helper('markdown'); and $text = markdown($text);[/em]
I added just a few lines of code to [url=http://www.michelf.com/projects/php-markdown/]PHP Markdown[/url] to integrate it as a CI library. This is a much less extensive hacking of the PHP Markdown source than the other CI integration (labeled for CI 1.4.x) already in the files area.
I can't see where to upload a file to this wiki, but just download [url=http://www.michelf.com/docs/projets/php-markdown-1.0.1f.zip]PHP Markdown 1.0.1f[/url], place it in your libraries/ folder as mkdn.php, and add these lines:
[code]
if(defined('BASEPATH')) { class Mkdn { function translate($text) { return Markdown($text); } } } [/code]