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