本文整理匯總了PHP中role::Load方法的典型用法代碼示例。如果您正苦於以下問題:PHP role::Load方法的具體用法?PHP role::Load怎麽用?PHP role::Load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類role
的用法示例。
在下文中一共展示了role::Load方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: intval
<?php
$page_title = 'Редактирование роли';
$id = intval(get_request_variable('id', 0));
$parent_id = intval(get_request_variable('parent_id', 0));
$name = get_request_variable('name', '');
$save = get_request_variable('save', '');
$enabled_action = get_request_variable('enabled_action', array());
$enabled_role_variables = get_request_variable('enabled_role_variables', array());
$_REQUEST['callback'] = get_request_variable('callback', '');
$role_actions = array();
$role = new role();
$role->id_role = $id;
if ($id > 0) {
if (!$role->Load()) {
$role->id_role = 0;
} else {
$role_actions = $role->GetRoleActionsId();
$role_actions = array_flip($role_actions);
$role_variables = $role->GetRoleVariablesId();
$role_variables = array_flip($role_variables);
}
}
// Получаем все типы дополнительных полей и сами поля
$variable = new variable();
$variable_modules = $variable->GetModules();
reset($variable_modules);
$variables = array();
while (list($variable_module, $variable_module_name) = each($variable_modules)) {
$variable_modules[$variable_module] = array();
$variable_modules[$variable_module]['name'] = $variable_module_name;
示例2: array
<?php
$page_title = 'Удаление роли';
$errors = array();
$id = intval(get_request_variable('id', 0));
$_REQUEST['callback'] = get_request_variable('callback', '');
$role = new role();
$role->id_role = $id;
if ($id > 0) {
if ($role->Load()) {
$errors = $role->IsValidData();
if (!$errors) {
$role->Delete();
}
}
}
include SITE_FILE_ROOT . 'template/simple_header.php';
include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php';
include SITE_FILE_ROOT . 'template/simple_footer.php';