happyr / slugify-bundle
A Symfony2 Bundle to slugify swedish texts
Installs: 20 655
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- jbroadway/urlify: 1.0.*
- symfony/framework-bundle: 2.*
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-25 07:03:19 UTC
README
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.
Installation
-
Install with composer:
php composer.phar require happyr/slugify-bundle
-
Enable the bundle:
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new HappyR\SlugifyBundle\HappyRSlugifyBundle(), ); }
Using the service
$slugifier = $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
happy_r_slugify: twig: false #set to true to enable twig filter