Get, find or save roles ($roles API variable as a function)

Accessing roles() is exactly the same as accessing $roles. Though there are a couple of optional shortcuts available by providing an argument to this function.

Please note this method is and thus not intended to be called directly.

Internal usage

// basic internal usage
$roles = roles();

// internal usage with all arguments
$roles = roles($selector = '');

Arguments

NameType(s)Description
$selector (optional)string int
  • Specify name or ID of role to get (Role object)
  • Specify selector string matching roles to find (PageArray object)

Return value


Functions methods and properties

API reference based on ProcessWire core version 3.0.251