$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

NameTypeRequiredDescription
stranyYesThe String to 'slugify'
maxLengthnumericNo (default=0)Max length of the resultant string. Will be trimmed to this length if longer.
allowanyNo (default="")A regex safe list of additional characters to allow
preserveCaseanyNo (default=false)Whether or not to allow mixed case. If false, default, the slug will be all lowercase.