$slugify()
Overview
public string function $slugify(
required any str
, numeric maxLength = 0
, any allow = ""
, any preserveCase = false
)
Proxy to the slugify method of Coldbox's HTMLHelper
Example
var slug = $slugify( "My Site: About Us" );
// Will return "my-site-about-us"
Arguments
Name | Type | Required | Description |
---|---|---|---|
str | any | Yes | The String to 'slugify' |
maxLength | numeric | No (default=0) | Max length of the resultant string. Will be trimmed to this length if longer. |
allow | any | No (default="") | A regex safe list of additional characters to allow |
preserveCase | any | No (default=false) | Whether or not to allow mixed case. If false, default, the slug will be all lowercase. |