本文整理汇总了PHP中Illuminate\Pagination\LengthAwarePaginator::make方法的典型用法代码示例。如果您正苦于以下问题:PHP LengthAwarePaginator::make方法的具体用法?PHP LengthAwarePaginator::make怎么用?PHP LengthAwarePaginator::make使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Pagination\LengthAwarePaginator
的用法示例。
在下文中一共展示了LengthAwarePaginator::make方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndexByParent
/**
* Show a list of all contacts By Parent
*
* @return View
*/
public function getIndexByParent($parent_id)
{
// Title
$title = 'Boite de réception';
try {
$page = Input::get('page', 1);
$limit = Input::get('limit', 10);
$sortBy = Input::get('sortBy', 'sort_order');
$sortDirection = Input::get('sortDirection', 'desc');
$data = $this->model->getByPage($page, $limit, $sortBy, $sortDirection, []);
$totalItems = $data->totalItems;
$limit = $data->limit;
$models = Paginator::make($data->items, $data->totalItems, $data->limit);
} catch (RequestException $e) {
echo $e->getRequest() . "\n";
if ($e->hasResponse()) {
echo $e->getResponse() . "\n";
}
exit;
}
JavaScript::put(['locale' => LaravelLocalization::setLocale(), 'collection' => $models->getcollection()->toJson()]);
$data = array('title' => $title, 'models' => $models, 'totalItems' => $totalItems, 'limit' => $limit, 'sortBy' => $sortBy, 'sortDirection' => $sortDirection, 'routes' => array('create' => 'admin/contacts/create'));
// Show the page
return View::make('admin.index', $data);
}