Plugin for parsing markdown text into HTML. Behavior and 2 helpers can be used. It uses PHP markdown as vendor.
Checkout the plugin into Plugin folder with submodules (Vendor)
cd app/Plugin
git clone --recursive https://github.com/LubosRemplik/CakePHP-Markdown-Plugin.git Markdown
Using the MarkdownHelper in views to parse parts
<?php
// in controller
public $helpers = array(
'Markdown.Markdown'
);
// in view
$text = '## Whatever'; // parsing as h2 tag
echo $this->Markdown->parse($text);
Using the MarkdownParseHelper to parse whole views (layouts, elements, views)
<?php
// in controller
public $helpers = array(
'Markdown.MarkdownParse'
);
Using the MarkdownBehavior in model
<?php
// in model
public $actsAs = array(
'Markdown.Markdown' => array(
'field' => array('title', 'content')
)
);
If you have any issue/question please submit it into issue tracker