本文整理匯總了PHP中app\Task::paginate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Task::paginate方法的具體用法?PHP Task::paginate怎麽用?PHP Task::paginate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Task
的用法示例。
在下文中一共展示了Task::paginate方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
$param['pageNo'] = 1;
$param['tasks'] = TaskModel::paginate(10);
if (Session::has('alert')) {
$param['alert'] = Session::get('alert');
}
return View::make('company.task.index')->with($param);
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(Request $request)
{
$tasks = Task::paginate(10);
$data = array("tasks" => $tasks);
if ($request->ajax()) {
return view('tasks.ajax.index', $data);
}
return view('tasks.index', $data);
}
示例3: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
// print_r(__::get(['foo' => ['bar' => 'ter']], 'foo.bar'));die;
// print_r(__::append([1, 2, 3], 4));die;
// echo 'here';die;
// $tasks = app\Models\Order::paginate(2);
$tasks = app\Task::paginate(2);
$tasks->setPath('tasks');
return view('tasks.index')->withTasks($tasks);
}
示例4: getTasks
/**
* @return \Illuminate\View\View
*/
public function getTasks()
{
//
$array_task = [];
$user = Sentinel::getUser();
$user_id = $user->id;
$task_paginate = Task::paginate(10);
$now = Carbon::today();
//tareas
$tasks = Task::where('user_id', '=', $user->id)->orwhere('role_id', '=', $user->roles[0]->id)->get();
foreach ($tasks as $task) {
if (is_null($task->status)) {
array_push($array_task, $task);
} elseif (!in_array($user->id, unserialize($task->status))) {
array_push($array_task, $task);
}
}
return view('notifications.tasks.index', compact('task_paginate', 'array_task', 'user_id', 'now'));
}