Skip to content

Commit

Permalink
Allow setting default tranliterator identifier string.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Mar 14, 2016
1 parent acc48a3 commit 5bfca19
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Utility/Text.php
Expand Up @@ -23,6 +23,13 @@
class Text
{

/**
* Default transliteration id.
*
* @param string $defaultTransliteratorId Transliterator identifer string.
*/
public static $defaultTransliteratorId = 'Any-Latin; Latin-ASCII';

/**
* Generate a random UUID version 4
*
Expand Down Expand Up @@ -865,7 +872,7 @@ public static function slug($string, $options = [])
{
$options += [
'replacement' => '-',
'transliteratorId' => 'Any-Latin; Latin-ASCII'
'transliteratorId' => static::$defaultTransliteratorId
];

$quotedReplacement = preg_quote($options['replacement'], '/');
Expand Down

0 comments on commit 5bfca19

Please sign in to comment.