Does this template have the given Role?
Usage
// basic usage
$bool = $template->hasRole($role);
// usage with all arguments
$bool = $template->hasRole($role, $type = 'view');
Arguments
Name | Type(s) | Description |
---|---|---|
role | string, Role, Page | Name of Role or Role object. |
type (optional) |
Return value
bool
True if template has the role, false if not
Template methods and properties
API reference based on ProcessWire core version 3.0.236