本文整理汇总了PHP中AuthUser::all方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthUser::all方法的具体用法?PHP AuthUser::all怎么用?PHP AuthUser::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthUser
的用法示例。
在下文中一共展示了AuthUser::all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* renvoi les données ou affiche le formulaire d'edition d'une tache
* @param Task $task [description]
* @return [type] [description]
*/
public function edit($task_id)
{
$task = Task::find($task_id);
$labels = TasksLabels::all();
$idsLabel = array();
foreach ($task->labels as $label) {
$idsLabel[] = $label->id;
}
$users = AuthUser::all();
$idsUser = array();
foreach ($task->auths as $user) {
$idsUser[] = $user->id;
}
return View::make('theme::' . 'admin.tasks.edit', array('task' => $task, 'user' => Auth::user(), 'noAriane' => true, 'labels' => $labels, 'idsLabel' => $idsLabel, 'users' => $users, 'idsUser' => $idsUser));
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//Check permission
if (!Auth::user()->hasPermission('manage', 'auth')) {
return Redirect::to('admin')->with('error', Lang::get('auth.you_are_not_authorized'));
}
//User
$data['user'] = Auth::user();
//All users
$data['users'] = AuthUser::all();
//Interface
$data['noAriane'] = true;
if (Request::ajax()) {
return Response::json(View::make('theme::' . 'admin.auth.index', $data)->renderSections());
} else {
return View::make('theme::' . 'admin.auth.index', $data);
}
}