Made group creation possible (open groups only, yet)

This commit is contained in:
Polonkai Gergely
2012-07-17 21:37:54 +02:00
parent cab47219b3
commit 9f49b70d67
237 changed files with 3054 additions and 254 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace KekRozsak\FrontBundle\Extensions;
class Slugifier
{
/**
* Slugify string
*
* @param string $text
* @return string
*/
public function slugify($text)
{
$text = trim(preg_replace('~[^\\pL\d]+~u', '-', $text));
if (function_exists('iconv'))
{
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
}
$text = strtolower($text);
$text = preg_replace('~[^-\w]+~', '', $text);
if (empty($text))
{
$text = 'n-a';
}
return $text;
}
}