hashnz/twig-markdown-bundle

用于 https://github.com/aptoma/twig-markdown 的包装器

安装量: 2,918

依赖项: 0

建议者: 0

安全性: 0

星标: 2

关注者: 2

分支: 1

开放问题: 0

类型:symfony-bundle

1.0.0 2014-09-03 01:51 UTC

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 %}