- Full name:
\Symfony\Component\String\Slugger\AsciiSlugger
- This class implements:
\Symfony\Component\String\Slugger\SluggerInterface
,\Symfony\Contracts\Translation\LocaleAwareInterface
Constant | Visibility | Type | Value |
---|---|---|---|
LOCALE_TO_TRANSLITERATOR_ID |
private | ['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'] |
private ?string $defaultLocale
private \Closure|array $symbolsMap
Cache of transliterators per locale.
private array $transliterators
public __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$defaultLocale |
string | |
$symbolsMap |
array|\Closure |
{@inheritdoc}
public setLocale(string $locale): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$locale |
string |
{@inheritdoc}
public getLocale(): string
Creates a slug for the given string and locale, using appropriate transliteration when needed.
public slug(string $string, string $separator = '-', string $locale = null): \Symfony\Component\String\AbstractUnicodeString
Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | |
$separator |
string | |
$locale |
string |
private createTransliterator(string $locale): ?\Transliterator
Parameters:
Parameter | Type | Description |
---|---|---|
$locale |
string |
private static getParentLocale(?string $locale): ?string
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$locale |
?string |