hashnz / twig-markdown-bundle
用于 https://github.com/aptoma/twig-markdown 的包装器
1.0.0
2014-09-03 01:51 UTC
Requires
- php: >=5.4
- aptoma/twig-markdown: ~1.0
- michelf/php-markdown: ~1.3
- symfony/symfony: ~2.1
This package is not auto-updated.
Last update: 2023-12-04 23:39:45 UTC
README
Symfony2 组件,封装了 aptoma/twig-markdown。
安装
添加到 composer.json
{
"require": {
"hashnz/twig-markdown-bundle": "dev-master"
}
}
在 app/AppKernel.php 中注册组件
$bundles = array(
// ...
new Hashnz\TwigMarkdownBundle\HashnzTwigMarkdownBundle(),
);
使用
作为过滤器
{{ "# Heading Level 1"|markdown }}
作为标签
{% markdown %}
# Heading Level 1
* List item 1
* List item 2
* Sub List Item
* Sub Sub List Item
{% endmarkdown %}