承接 kitzberger/cakephp-markdown 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kitzberger/cakephp-markdown

最新稳定版本:4.0.0

Composer 安装命令:

composer require kitzberger/cakephp-markdown

包简介

Cakephp Markdown plugin for CakePHP 4.x

README 文档

README

Build Status License Total Downloads

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

Installation

composer require kitzberger/cakephp-markdown:dev-main

Configuration & Usage

To your config/bootstrap.php file add \App\Application::addPlugin('Tanuck/Markdown');

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

class FooController extends AppController
{
    public function initialize(): void
    {
        parent::initialize();
        $this->viewBuilder()->setHelpers(['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 function initialize(): void
    {
        parent::initialize();
        $this->viewBuilder()->setHelpers([
			'Tanuck/Markdown.Markdown' => [
				'parser' => 'GithubMarkdown',
			]
		]);
    }
}

License

cakephp-markdown is offered under an MIT license.

统计信息

  • 总下载量: 45
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-20