https://github.com/shapecode/twig-collector-extension
https://github.com/shapecode/twig-collector-extension
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/shapecode/twig-collector-extension
- Owner: shapecode
- License: mit
- Created: 2016-06-06T09:03:51.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-22T12:47:58.000Z (over 7 years ago)
- Last Synced: 2025-02-17T00:17:28.627Z (about 1 year ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shapecode - Twig Collector Extension
[](https://insight.sensiolabs.com/projects/e3c8e229-09ac-4ec7-94cb-5c6c18dd095f)
[](https://packagist.org/packages/shapecode/twig-collector-extension)
[](https://packagist.org/packages/shapecode/twig-collector-extension)
[](https://packagist.org/packages/shapecode/twig-collector-extension)
[](https://packagist.org/packages/shapecode/twig-collector-extension)
## Install instructions
Via Composer
``` bash
$ composer require shapecode/twig-collector-extension
```
Add Extension to your Twig Environment
``` php
addExtension(new CollectorExtension());
```
## Usage
collect stuff over all templates
``` twig
{% collector stylesheets %}
.body {
margin-bottom: 10px;
}
{% endcollector %}
```
... and output it at a specific line
``` twig
{% collection stylesheets %}
```