Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcj/twig-apply_filter-bundle
Symfony Bundle for Twig 'apply_filter' to call dynamic filters.
https://github.com/marcj/twig-apply_filter-bundle
Last synced: 21 days ago
JSON representation
Symfony Bundle for Twig 'apply_filter' to call dynamic filters.
- Host: GitHub
- URL: https://github.com/marcj/twig-apply_filter-bundle
- Owner: marcj
- Created: 2013-12-12T13:03:46.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-24T18:08:20.000Z (almost 6 years ago)
- Last Synced: 2024-02-14T22:33:58.593Z (4 months ago)
- Language: PHP
- Homepage:
- Size: 137 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Lists
- awesome-twig - Apply Filters - This filter allows you to call dynamic filters in twig. (Twig / Extensions)
- awesome-twig - Apply Filters - This filter allows you to call dynamic filters in twig. (Twig / Extensions)
README
Twig apply_filter
================This filter allows you to call dynamic filters in twig.
[![Build Status](https://travis-ci.org/marcj/twig-apply_filter-bundle.png?branch=master)](https://travis-ci.org/marcj/twig-apply_filter-bundle)
Examples
-------```twig
{{ set filters = 'upper|nl2br' }}{{ value|apply_filter(filters) }}
{{ value|apply_filter("default('abc')|json_encode") }}
```A filter for e.g. a News system, where the title filter is stored in the database:
```twig
{% for item in newsItems %}
{{ item.title|apply_filter(databaseSettings.newsFilter) }}
{% endfor %}
```Installation
------------### Install via composer
```bash
composer.phar require marcj/twig-apply_filter-bundle
```### Activate bundle
Open your AppKernel.php
```php