Skip to content

Kirby 6.0.0

Roles::factory()

Creates a roles collection from the given role definitions and always includes the admin role

Roles::factory(array> $roles, array $inject = []): Roles

Parameters

Name Type Default Description
$rolesrequired array<array<string, mixed>> no default value
$inject array<string, mixed> [] Props to add to each role if not defined

Return type

Kirby\Cms\Roles

Parent class

Kirby\Cms\Roles