eschmar/slugify-bundle

Provides static method to convert strings to slugs and twig filter.

Installs: 563

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

v2.0.0 2019-06-22 18:10 UTC

This package is auto-updated.

Last update: 2024-03-23 05:05:46 UTC


README

Provides static method to convert strings to slugs as well as a twig filter for symfony. If you only need the static class, you'll find it here.

Install

Composer (Packagist):

composer require eschmar/slugify-bundle ~v2.0 # Symfony Flex
composer require eschmar/slugify-bundle ~v1.0 # Symfony 2

app/Appkernel.php:

new Eschmar\SlugifyBundle\EschmarSlugifyBundle(),

Usage

use Eschmar\SlugifyBundle\Util\Slug;
$test = Slug::ify("String to be slugified");
// results in $test == "string-to-be-slugified"

Twig Extension

{{ "String to be slugified"|slugify }}

License

MIT License