Mapado TwigExtensions Bundle
MapadoTwigExtensionsBundle is just a collection of useful Twig extensions., (*1)
This bundle should be used in conjunction with Symfony2., (*2)
ParseUrl Filter
Provides an parse_url
filter, to parse an url., (*3)
A call to parse_url is made., (*4)
{{ someUrl | parse_url('host') }}
Will return the host of someUrl
(or false
if not found)., (*5)
Installation
Get the bundle
Add this in your composer.json, (*6)
{
"require": {
"mapado/twig-extensions-bundle": "dev-master"
}
}
and then run, (*7)
php composer.phar update
or, (*8)
composer update
if you installed composer globally., (*9)
Enable the bundle
// in app/AppKernel.php
public function registerBundles() {
$bundles = array(
// ...
new Mapado\TwigExtensionsBundle\MapadoTwigExtensionsBundle(),
);
// ...
}