shapecode/twig-collector-extension-bundle

此包已被弃用且不再维护。未建议替代包。

shapecode/twig-collector-extension 的 Symfony Bundle。

1.3.0 2018-06-08 11:41 UTC

This package is auto-updated.

Last update: 2023-12-03 12:19:38 UTC


README

SensioLabsInsight Latest Stable Version Total Downloads Latest Unstable Version License

安装说明

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