Skip to content

shapecode/twig-collector-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shapecode - Twig Collector Extension

SensioLabsInsight Latest Stable Version Total Downloads Latest Unstable Version License

Install instructions

Via Composer

$ composer require shapecode/twig-collector-extension

Add Extension to your Twig Environment

<?php 

use Twig\Environment;
use Shapecode\Twig\Extensions\Extension\CollectorExtension;

$twig = new Environment($loader);
$twig->addExtension(new CollectorExtension());

Usage

collect stuff over all templates

{% collector stylesheets %}
<style>
    .body {
        margin-bottom: 10px;
    }
</style>
{% endcollector %}

... and output it at a specific line

{% collection stylesheets %}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages