tanuck/cakephp-markdown
最新稳定版本:v0.1.0
Composer 安装命令:
composer require tanuck/cakephp-markdown
包简介
Cakephp Markdown plugin for CakePHP 3.
README 文档
README
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.
- Markdown - using the original syntax definition: http://daringfireball.net/projects/markdown/syntax
- GithubMarkdown - GitHubs own markdown flavour: https://help.github.com/articles/github-flavored-markdown/
- MarkdownExtra - an extension of the original by michelf: http://michelf.ca/projects/php-markdown/extra/
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.
统计信息
- 总下载量: 27.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-14