Note: This repository is abandonded. Use https://github.com/PhileCMS/phileTwigFilters instead.
A plugin for Phile that adds a Twig filter that will slugify a string
php composer.phar require phile/twigSlugify:*
- Install Phile
- Clone this repo into
plugins/phile/twigSlugify
After you have installed the plugin. You need to add the following line to your config.php
file:
- add
$config['plugins']['phile\\twigSlugify'] = array('active' => true);
to yourconfig.php
This new Twig filter allows you to slugify a string. This is useful for making safe URLs, HTML-safe class/id names, or just cleaning up general strings.
{{ current_page.title | slugify }}
{{ "This Is an UNSAFE __and strange string" | slugify }}