shapecode / twig-collector-extension
Ability to collect html code.
Installs: 1 276
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:lib
Requires
- php: ~5.6|~7.0
- twig/twig: ~1.34|~2.0
This package is auto-updated.
Last update: 2023-12-03 12:19:44 UTC
README
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 %}