1
0
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:
Marco
2017-07-29 18:52:18 +02:00
parent 8a1140a485
commit 9c63c30cd9

View File

@@ -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;
}