AsciiSlugger
in package
implements
SluggerInterface, LocaleAwareInterface
Tags
Table of Contents
Interfaces
- SluggerInterface
- Creates a URL-friendly slug from a given string.
- LocaleAwareInterface
Methods
- __construct() : mixed
- getLocale() : string
- setLocale() : void
- slug() : AbstractUnicodeString
- Creates a slug for the given string and locale, using appropriate transliteration when needed.
- withEmoji() : static
Methods
__construct()
public
__construct([string|null $defaultLocale = null ][, array<string|int, mixed>|Closure|null $symbolsMap = null ]) : mixed
Parameters
- $defaultLocale : string|null = null
- $symbolsMap : array<string|int, mixed>|Closure|null = null
getLocale()
public
getLocale() : string
Return values
stringsetLocale()
public
setLocale(string $locale) : void
Parameters
- $locale : string
slug()
Creates a slug for the given string and locale, using appropriate transliteration when needed.
public
slug(string $string[, string $separator = '-' ][, string|null $locale = null ]) : AbstractUnicodeString
Parameters
- $string : string
- $separator : string = '-'
- $locale : string|null = null
Return values
AbstractUnicodeStringwithEmoji()
public
withEmoji([bool|string $emoji = true ]) : static
Parameters
- $emoji : bool|string = true
-
true will use the same locale, false will disable emoji, and a string to use a specific locale