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.

Usage

// basic usage
$roles = roles();

// 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.244

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH