helpers\BaseInflector slug()

slug() public static method

Returns a string with all spaces converted to given replacement, non word characters removed and the rest of characters transliterated.

If intl extension isn't available uses fallback that converts latin characters only and removes the rest. You may customize characters map via $transliteration property of the helper.

public static string slug ( $string, $replacement = '-', $lowercase = true )
$string string

An arbitrary string to convert

$replacement string

The replacement to use for spaces

$lowercase boolean

Whether to return the string in lowercase or not. Defaults to true.

return string

The converted string.

doc_Yii
2016-10-30 17:05:25
Comments
Leave a Comment

Please login to continue.