Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (26 sloc) 725 Bytes
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\CategorizerBundle\Inflector;
/**
* Slugizer.
*
* @author Paweł Jędrzejewski <pjedrzejewski@diweb.pl>
* @author Саша Стаменковић <umpirsky@gmail.com>
*/
class Slugizer implements SlugizerInterface
{
/**
* {@inheritdoc}
*/
public function slugize($string)
{
return preg_replace('/[^a-z0-9_\s-]/', '', preg_replace("/[\s_]/", "-", preg_replace('!\s+!', ' ', strtolower(trim(iconv('UTF-8', 'ASCII//TRANSLIT', $string))))));
}
}
Something went wrong with that request. Please try again.