本文整理汇总了PHP中Results::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Results::all方法的具体用法?PHP Results::all怎么用?PHP Results::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Results
的用法示例。
在下文中一共展示了Results::all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndex
public function getIndex()
{
$data['pageTitle'] = "Quizzler | Users";
//$data['urlAddBack'] = "backends/users/add";
$data['urlAddBack'] = "#";
$data['btnAddBack'] = '<i class="icon-plus"></i><span>Add<span>';
$data['labelPage'] = "The Quizzler";
if (isset($_GET['keyword'])) {
$userRoleId = $_GET['keyword'];
if ($_GET['keyword'] != '') {
$data['users'] = User::where('user_role_id', $userRoleId)->orderBy('created_at', 'asc')->paginate(10);
} else {
$data['users'] = User::orderBy('created_at', 'asc')->paginate(10);
}
} else {
$userRoleId = 1;
$data['users'] = User::where('user_role_id', $userRoleId)->orderBy('created_at', 'asc')->paginate(10);
}
$data['userType'] = $userRoleId;
$userRole = Userrole::orderBy('name', 'asc')->get();
$userRoleArr = ['' => '-- All users --'];
foreach ($userRole as $role) {
$userRoleArr[$role->id] = $role->name;
}
$data['userRole'] = $userRoleArr;
$result = Results::all();
$resultArr = [];
foreach ($result as $rs) {
$resultArr[$rs->user_id] = $rs->user_id;
}
$data['resultArr'] = $resultArr;
$data['formOrigin'] = "users";
$data['activeU'] = 'active';
return View::make('backends.users.users', $data);
}