Skip to content

Instantly share code, notes, and snippets.

@MikSDigital
Created June 3, 2018 20:43
Show Gist options
  • Save MikSDigital/5577ea8cd6493f2e427ff305f8f22c5a to your computer and use it in GitHub Desktop.
Save MikSDigital/5577ea8cd6493f2e427ff305f8f22c5a to your computer and use it in GitHub Desktop.
Seen in Enhavo CMS, slugifier via Gedmo
<?php
/**
* Slugifier.php
*
* @since 23/03/17
* @author gseidel
*/
namespace Enhavo\Bundle\AppBundle\Slugifier;
use Gedmo\Sluggable\Util\Urlizer;
class Slugifier implements SlugifierInterface
{
public static function slugify($content, $separator = '-')
{
$urlizer = new Urlizer();
$content = $urlizer->urlize($content, $separator);
$content = $urlizer->transliterate($content, $separator);
return $content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment