DEPRECATION NOTICE: This CakePHP 2.x plugin is deprecated and will most likely not be updated.
A PHP Markdown helper packaged as a plugin.
This plugin works with Composer and is available on Packagist.
If you are using composer, require chronon/markdown
:
{
"require": {
"chronon/markdown": "*"
},
"config": {
"vendor-dir": "Vendor"
}
}
This will install the plugin into Plugin/Markdown
, and install Markdown lib (from Packagist) into
your Vendor
directory.
In Config/bootstrap.php
, import composer's autoload file:
<?php
App::import('Vendor', array('file' => 'autoload'));
Using git:
If you are not using composer, clone the repository:
git clone [email protected]:chronon/CakePHP-Markdown-Plugin.git APP/Plugin/Markdown
In your controller:
<?php
public $helpers = array('Markdown.Markdown');
In your view:
<?php
echo $this->Markdown->md(markdown_to_be_converted_to_html);