Slug

February 3, 2026 · View on GitHub

  • Slug()

Validates whether the input is a valid slug.

v::slug()->assert('my-wordpress-title');
// Validation passes successfully

v::slug()->assert('my-wordpress--title');
// → "my-wordpress--title" must be a slug

v::slug()->assert('my-wordpress-title-');
// → "my-wordpress-title-" must be a slug

Templates

Slug::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be a slug
inverted{{subject}} must not be a slug

Template placeholders

PlaceholderDescription
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Strings

Changelog

VersionDescription
3.0.0Templates changed
0.3.9Created

See Also