PagesNames::uniqueRandomPageName()

Get a random, globally unique page name

Usage

// basic usage
$string = $pagesNames->uniqueRandomPageName();

// usage with all arguments
$string = $pagesNames->uniqueRandomPageName(array $options = []);

Arguments

NameType(s)Description
$options (optional)array
  • page (Page): If name is or should be assigned to a Page, specify it here. Default:null
  • length (int): Required/fixed length, or omit for random length Default:0
  • min (int): Minimum required length, if fixed length not specified Default:6
  • max (int): Maximum allowed length, if fixed length not specified Default:min*2
  • alpha (bool): Include alpha a-z letters? Default:true
  • numeric (bool): Include numeric digits 0-9? Default:true
  • confirm (bool): Confirm that name is globally unique? Default:true
  • parent (Page|int): If specified, name must only be unique for this parent Page or ID Default:0
  • prefix (string): Prepend this prefix to page name Default:''
  • suffix (string): Append this suffix to page name Default:''

Return value

string


PagesNames methods and properties

API reference based on ProcessWire core version 3.0.251