Slugify Bundle

This bundle provides integration of the URLify library into Symfony2. A slugify service and twig filter is provided. This bundle is a modified version of the ZenstruckSlugifyBundle. The ZenstruckSlugifyBundle uses the Slugify library.


  1. Install with composer:

    php composer.phar require happyr/slugify-bundle
  2. Enable the bundle:

    // app/AppKernel.php
    public function registerBundles()
            // ...
            new HappyR\SlugifyBundle\HappyRSlugifyBundle(),

Using the service

<br />$slugifier</h3> $this->container->get('happyr.slugify.slugifier');
$text = $slugifier->slugify('Hello World!');
echo $text; //prints "hello-world"

Using the Twig filter

{{ 'Hello World!'|slugify }} {# hello-world #}

Full Default Configuration

    twig: false #set to true to enable twig filter