Skip to content

Kirby 6.0.0

Url::slug()

Convert a string to a safe version to be used in a URL, obeying the slugs.maxlength option

Url::slug(string|null $string = null, string|null $separator = null, string|null $allowed = null): string

Parameters

Name Type Default Description
$string stringornull null
$separator stringornull null To be used instead of space and other non-word characters.
$allowed stringornull null List of all allowed characters (regex)

Return type

string

Parent class

Kirby\Cms\Url