tanuck/cakephp-markdown

Cakephp Markdown plugin for CakePHP 3.

Installs: 18 960

Dependents: 0

Suggesters: 0

Security: 0

Stars: 7

Watchers: 6

Forks: 5

Open Issues: 5

Type:cakephp-plugin

v0.1.0 2015-02-20 22:16 UTC

This package is not auto-updated.

Last update: 2024-10-26 17:19:00 UTC


README

Build Status License Total Downloads

CakePHP 3 plugin to parse markdown syntax in your view templates.

Installation

Include the following in your composer.json file:

    "require": {
        "tanuck/cakephp-markdown": "dev-master"
    }

and then run:

composer update

Configuration & Usage

To your config/bootstrap.php file add Plugin::load('Tanuck/Markdown');

Then, load the helper where needed. For example, in your controller:

    class FooController extends AppController
    {
        public $helpers = ['Tanuck/Markdown.Markdown'];
    }

then in your templates, you can output markdown syntax like so:

    echo $this->Markdown->transform($myMarkdownSyntax);

Advanced Configuration

Markdown is rendered using the cebe/markdown library which offers 3 different markdown parser classes.

By default, the plugin will use Markdown, the first of the 3 above. However you can specify which of the 3 you use wish to use when loading the helper. Like so:

    class FooController extends AppController
    {
        public $helpers = [
            'Tanuck/Markdown.Markdown' => [
                'parser' => 'GithubMarkdown'
            ]
        ];
    }

License

cakephp-markdown is offered under an MIT license.