Skip to content

Slug

  • Full name: \Zemit\Support\Slug

Methods

generate

Creates a slug to be used for pretty URLs

public static generate(string $string, array $replace = [], string $delimiter = '-'): string
  • This method is static.

Parameters:

Parameter Type Description
$string string
$replace array
$delimiter string

restoreLocale

Restore the locale settings based on the provided old locale.

private static restoreLocale(string|string[] $oldLocale): void
  • This method is static.

Parameters:

Parameter Type Description
$oldLocale **string string[]**

cleanString

Replace non-letter or non-digits by - Trim trailing -

public static cleanString(string $string, string $delimiter): string
  • This method is static.

Parameters:

Parameter Type Description
$string string
$delimiter string