shapecode / twig-collector-extension-bundle
此包已被弃用且不再维护。未建议替代包。
shapecode/twig-collector-extension 的 Symfony Bundle。
1.3.0
2018-06-08 11:41 UTC
Requires
- php: ~5.5|~7.0
- shapecode/twig-collector-extension: ~1.3
- symfony/config: ~2.8|~3.0|~4.0
- symfony/dependency-injection: ~2.8|~3.0|~4.0
- symfony/http-kernel: ~2.8|~3.0|~4.0
- symfony/twig-bundle: ~2.8|~3.0|~4.0
This package is auto-updated.
Last update: 2023-12-03 12:19:38 UTC
README
安装说明
通过 Composer
$ composer require shapecode/twig-collector-extension-bundle
在您的内核中启用该扩展包
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Shapecode\Bundle\TwigCollectorBundle\ShapecodeTwigCollectorBundle(), ); }
使用方法
在整个模板中收集内容
{% collector stylesheets %} <style> .body { margin-bottom: 10px; } </style> {% endcollector %}
...并在特定行输出
{% collection stylesheets %}