https://github.com/mapado/twigextensionsbundle
Some cool Twig extensions (parse_url for now)
https://github.com/mapado/twigextensionsbundle
Last synced: 9 months ago
JSON representation
Some cool Twig extensions (parse_url for now)
- Host: GitHub
- URL: https://github.com/mapado/twigextensionsbundle
- Owner: mapado
- License: other
- Created: 2013-01-18T12:59:35.000Z (over 13 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T07:55:24.000Z (over 2 years ago)
- Last Synced: 2025-08-04T12:34:13.317Z (10 months ago)
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 12
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Mapado TwigExtensions Bundle
====================
MapadoTwigExtensionsBundle is just a collection of useful Twig extensions.
This bundle should be used in conjunction with Symfony2.
### ParseUrl Filter
Provides an `parse_url` filter, to parse an url.
A call to [parse_url](http://php.net/manual/en/function.parse-url.php) is made.
{{ someUrl | parse_url('host') }}
Will return the host of `someUrl` (or `false` if not found).
## Installation
### Get the bundle
Add this in your composer.json
```json
{
"require": {
"mapado/twig-extensions-bundle": "dev-master"
}
}
```
and then run
```sh
php composer.phar update
```
or
```sh
composer update
```
if you installed composer globally.
### Enable the bundle
```php
// in app/AppKernel.php
public function registerBundles() {
$bundles = array(
// ...
new Mapado\TwigExtensionsBundle\MapadoTwigExtensionsBundle(),
);
// ...
}
```