mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-07-30 21:00:13 +02:00
Add method in 'tests' that creates list of roles for HTML 'select'
This commit is contained in:
@@ -500,3 +500,15 @@ function showGuestUserForm() {
|
||||
echo '<button type="submit">Delete user by username</button>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
function createRolesOptions() {
|
||||
$roleReflection = new ReflectionClass(\Delight\Auth\Role::class);
|
||||
|
||||
$out = '';
|
||||
|
||||
foreach ($roleReflection->getConstants() as $roleName => $roleValue) {
|
||||
$out .= '<option value="' . $roleValue . '">' . $roleName . '</option>';
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user