2017 © Pedro Peláez
 

cakephp-plugin cakephp3-markdown

CakePHP 3.x - Markdown

image

ivanamat/cakephp3-markdown

CakePHP 3.x - Markdown

  • Sunday, February 18, 2018
  • by ivanamat
  • Repository
  • 3 Watchers
  • 2 Stars
  • 967 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

CakePHP 3.x - Markdown

Installation

Composer

You can install this plugin into your CakePHP application using composer., (*1)

The recommended way to install composer packages is:, (*2)

composer require ivanamat/cakephp3-markdown

Git submodule

git submodule add git@github.com:ivanamat/cakephp3-markdown.git plugins/Markdown
git submodule init
git submodule update

Load

Component

Load component in the initialize() function, (*3)

    class MyController extends AppController {

        public function initialize() {
            parent::initialize();

            $this->loadComponent('Markdown.Markdown');
        }

    }

...or load the component in the array of components., (*4)

    class MyController extends AppController {

        public $components = [
            'Markdown' => [
                'className' => 'Markdown.Markdown'
            ]
        ];

    }

Helper

Load helper in the initialize() function from your View, (*5)

    class AppView extends View {

        public function initialize() {
            parent::initialize();

            $this->loadHelper('Markdown.Markdown');
        }

    }

Easy to use

Controller

Example: Read .md file on the controller, parse and pass html code to view., (*6)

    # MyController

    $md = file_get_contents('../README.md', true);
    $html = $this->Markdown->parse($md);
    $this->set(compact('html'));

Helper

Example: Parse Markdown data on the view., (*7)

    # MyController

    $md = '`This` string `is an example` of **Markdown** code';
    $this->set(compact('md'));
    

    <?php echo $this->Markdown->parse($md); ?>

About CakePHP 3.x - Markdown

CakePHP 3.x - Markdown uses the Parsedown third-party library.
You can download Parsedown from official website: http://parsedown.org/., (*8)

Author

Iván Amat on GitHub
www.ivanamat.es, (*9)

The Versions

18/02 2018

dev-master

9999999-dev https://github.com/ivanamat/cakephp3-markdown

CakePHP 3.x - Markdown

  Sources   Download

MIT

The Requires

 

plugin cakephp markdown cakephp3 cake3 parsedown

18/02 2018

1.1

1.1.0.0 https://github.com/ivanamat/cakephp3-markdown

CakePHP 3.x - Markdown

  Sources   Download

MIT

The Requires

 

plugin cakephp markdown cakephp3 cake3 parsedown

11/08 2016

1.0

1.0.0.0 https://github.com/ivanamat/cakephp3-markdown

Twitter Bootstrap Theme

  Sources   Download

MIT

The Requires

 

plugin cakephp markdown cakephp3 cake3 parsedown