demontpx/parsedown-bundle
最新稳定版本:3.0.2
Composer 安装命令:
composer require demontpx/parsedown-bundle
包简介
Parsedown (markdown) bundle for Symfony
README 文档
README
Provides the parsedown service and twig filter for Symfony
Installation
Require the bundle using composer:
composer require demontpx/parsedown-bundle ^1.3
Then add it to your bundles section in AppKernel.php:
new Demontpx\ParsedownBundle\DemontpxParsedownBundle()
Usage
Then you can use it in your twig templates:
{{ text|markdown }}
{{ '# This is a header!'|markdown }}
or directly from PHP:
$parsedown = $container->get('demontpx_parsedown.parsedown'); $parsedText = $parsedown->text($text);
You can also use the controller to parse markdown using an REST call. Add this to your routing.yml:
demontpx_parsedown: resource: "@DemontpxParsedownBundle/Resources/config/routing.yml" prefix: /parsedown/
After that you'll be able to send a POST request with markdown to http://your-apps-url/parsedown/ and it will return the parsed HTML. You might want to use this to render previews using javascript or something!
统计信息
- 总下载量: 25.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-28