本文整理汇总了PHP中link::auth方法的典型用法代码示例。如果您正苦于以下问题:PHP link::auth方法的具体用法?PHP link::auth怎么用?PHP link::auth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类link
的用法示例。
在下文中一共展示了link::auth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEdit
public function getEdit($id)
{
Allow::permission($this->module['group'], 'groups');
if ($id == 1 && !Allow::superuser()) {
Redirect(link::auth($this->module['rest']));
}
$groups = Group::all();
$group = Group::find($id);
$mod_actions = Config::get('mod_actions');
$mod_info = Config::get('mod_info');
#Helper::dd($mod_actions);
#Helper::dd($mod_info);
$group_actions = Action::where('group_id', $group->id)->get();
#$actions = $group->actions();
$actions = array();
foreach ($group_actions as $action) {
#Helper::d($action->status);
#continue;
if ($action->status) {
$actions[$action->module][$action->action] = $action->status;
}
}
#Helper::dd($actions);
$group_actions = $actions;
return View::make($this->module['tpl'] . 'edit', compact('groups', 'group', 'mod_actions', 'mod_info', 'group_actions'));
}
示例2: postStore
public function postStore()
{
Allow::permission($this->module['group'], 'users');
$json_request = array('status' => FALSE, 'responseText' => '', 'responseErrorText' => '', 'redirect' => FALSE);
$input = array('name' => Input::get('name'), 'group_id' => (int) Input::get('group'), 'email' => Input::get('email'), 'password' => Hash::make(Input::get('password1')));
$validation = Validator::make($input, User::$rules);
if ($validation->passes()) {
$user = User::create($input);
#return link::auth('groups');
$json_request['responseText'] = "Пользователь добавлен";
#$json_request['responseText'] = print_r(Input::get('actions'), 1);
$json_request['redirect'] = link::auth('system/' . $this->module['rest'] . '/edit/' . $user->id);
$json_request['status'] = TRUE;
} else {
#return Response::json($v->messages()->toJson(), 400);
$json_request['responseText'] = 'Неверно заполнены поля';
$json_request['responseErrorText'] = implode($validation->messages()->all(), '<br />');
}
return Response::json($json_request, 200);
}