\Symfony\Component\String\SluggerAsciiSlugger

Summary

Methods
Properties
Constants
__construct()
setLocale()
getLocale()
slug()
No public properties found
LOCALE_TO_TRANSLITERATOR_ID
No protected methods found
No protected properties found
N/A
createTransliterator()
$defaultLocale
$symbolsMap
$transliterators
N/A

Constants

LOCALE_TO_TRANSLITERATOR_ID

LOCALE_TO_TRANSLITERATOR_ID = ['am' => 'Amharic-Latin', 'ar' => 'Arabic-Latin', 'az' => 'Azerbaijani-Latin', 'be' => 'Belarusian-Latin', 'bg' => 'Bulgarian-Latin', 'bn' => 'Bengali-Latin', 'de' => 'de-ASCII', 'el' => 'Greek-Latin', 'fa' => 'Persian-Latin', 'he' => 'Hebrew-Latin', 'hy' => 'Armenian-Latin', 'ka' => 'Georgian-Latin', 'kk' => 'Kazakh-Latin', 'ky' => 'Kirghiz-Latin', 'ko' => 'Korean-Latin', 'mk' => 'Macedonian-Latin', 'mn' => 'Mongolian-Latin', 'or' => 'Oriya-Latin', 'ps' => 'Pashto-Latin', 'ru' => 'Russian-Latin', 'sr' => 'Serbian-Latin', 'sr_Cyrl' => 'Serbian-Latin', 'th' => 'Thai-Latin', 'tk' => 'Turkmen-Latin', 'uk' => 'Ukrainian-Latin', 'uz' => 'Uzbek-Latin', 'zh' => 'Han-Latin']

Properties

$defaultLocale

$defaultLocale

$symbolsMap

$symbolsMap

$transliterators

$transliterators : \Transliterator[]

Cache of transliterators per locale.

Type

Transliterator[]

Methods

__construct()

__construct(string  $defaultLocale = null, array|\Closure|null  $symbolsMap = null) : mixed

Parameters

string $defaultLocale
array|\Closure|null $symbolsMap

Returns

mixed —

setLocale()

setLocale(mixed  $locale) : mixed

{@inheritdoc}

Parameters

mixed $locale

Returns

mixed —

getLocale()

getLocale() : mixed

{@inheritdoc}

Returns

mixed —

slug()

slug(string  $string, string  $separator = '-', string  $locale = null) : \Symfony\Component\String\AbstractUnicodeString

Creates a slug for the given string and locale, using appropriate transliteration when needed.

Parameters

string $string
string $separator
string $locale

Returns

\Symfony\Component\String\AbstractUnicodeString —

createTransliterator()

createTransliterator(string  $locale) : ?\Transliterator

Parameters

string $locale

Returns

?\Transliterator —