本文整理匯總了PHP中role::get_roles方法的典型用法代碼示例。如果您正苦於以下問題:PHP role::get_roles方法的具體用法?PHP role::get_roles怎麽用?PHP role::get_roles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類role
的用法示例。
在下文中一共展示了role::get_roles方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getRoleList
public static function getRoleList()
{
Doo::loadClassAt('Role', 'default');
$role = new role();
$roles = $role->get_roles();
return array(Doo::conf()->adminRoleId => $roles[Doo::conf()->adminRoleId]);
}
示例2: isset
<?php
Doo::loadClassAt('Menu', 'default');
Doo::loadClassAt('Role', 'default');
Doo::loadClassAt('User', 'default');
$_SERVER['REDIRECT_URL'] = isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : '';
$role = new role(DBproxy::getManage());
$user = new user(DBproxy::getManage());
$data['userinfo'] = $userinfo = $user->getUserInfo();
$roles = $role->get_roles();
$data['menu'] = new menu(DBproxy::getManage());
$role_name = array();
if (!empty($userinfo['roleids'])) {
foreach ($userinfo['roleids'] as $roleid) {
$role_names[] = $roles[$roleid];
}
}
$role_name = $role_name_s = !empty($role_names) ? implode(', ', $role_names) : '';
if (!empty($role_names) && count($role_names) > 1) {
$role_name_s = $role_names[0] . '...';
} else {
$role_name_s = $role_names[0];
}
//頂部導航index
$data['top'] = isset($_GET['top']) ? $_GET['top'] : -1;
if (isset($_GET['top'])) {
$data['top'] = $_SESSION['menu_top'] = $_GET['top'];
} else {
$data['top'] = isset($_SESSION['menu_top']) ? $_SESSION['menu_top'] : $data['menu']->getTop();
}
$data['role_name_s'] = $role_name_s;