Created
June 3, 2018 20:43
-
-
Save MikSDigital/5577ea8cd6493f2e427ff305f8f22c5a to your computer and use it in GitHub Desktop.
Seen in Enhavo CMS, slugifier via Gedmo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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