本文整理汇总了PHP中Paginator::setPageName方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::setPageName方法的具体用法?PHP Paginator::setPageName怎么用?PHP Paginator::setPageName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paginator
的用法示例。
在下文中一共展示了Paginator::setPageName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createPaginator
/**
* (non-PHPdoc)
* @see \Mawelous\Yamop\Mapper::_createPaginator()
*/
protected function _createPaginator($results, $totalCount, $perPage, $page, $options)
{
if ($options) {
\Paginator::setPageName($options);
$paginator = \Paginator::make($results, $totalCount, $perPage);
\Paginator::setPageName('page');
} else {
$paginator = \Paginator::make($results, $totalCount, $perPage);
}
return $paginator;
}
示例2: show
public function show($id)
{
$project = Project\Project::find($id);
$title = $project ? link_to($project->getURL(), $project->title) : NULL;
Paginator::setPageName('tasks_page');
$tasks = Task\Task::unClaimed()->whereHas('Project', function ($q) use($id) {
$q->where('id', '=', $id);
})->paginate(16);
Paginator::setPageName('claimed_tasks_page');
$claimed_tasks = Task\Task::claimed()->whereHas('Project', function ($q) use($id) {
$q->where('id', '=', $id);
})->paginate(8);
return View::make('site.tasks.index', ['tasks' => $tasks, 'title' => $title, 'claimed_tasks' => $claimed_tasks]);
}
示例3: GetInvoiceList
/**
* User order/transaction history
*
* @param array $option
* @return \Illuminate\Database\Eloquent\Model
*/
public function GetInvoiceList(array $option = array())
{
$user = \Auth::user();
$data = \OrderPayment::with(['Order' => function ($query) {
$query->with('User', 'OrderSchedule', 'DeliverySchedule', 'ReturnSchedule');
}]);
if ($user->type == "user") {
$data->whereHas('Order', function ($query) use($user) {
$query->where('user_id', $user->id);
});
} elseif ($user->type == "driver") {
if (!empty($option['page_name'])) {
\Paginator::setPageName($option['page_name']);
}
$data->where('status', 2)->orderBy('created_at', 'desc');
}
return $data->paginate(20);
}
示例4: array
@endif
</section>
<div class="turtle-break" id="claimed-task">
<div class="turtle-line"></div>
<div class="turtle-svg">
{{print_svg('assets/img/happy-turtle.svg')}}
</div>
{{-- <img src="{{asset('assets/img/happy-turtle.svg')}}" width="111px" height="58px" /> --}}
<div class="turtle-line"></div>
<h3>Claimed Tasks{{isset($title)?' for '.$title:''}}:</h3>
</div>
<section class="content" id="claimed-tasks-content">
@if ($claimed_tasks->count()>0)
@foreach ($claimed_tasks as $task)
@include('site.tasks.card', array('task' => $task, 'show_button'=>false))
@endforeach
<?php
Paginator::setPageName('claimed_tasks_page');
?>
{{$claimed_tasks->appends('claimed_tasks_page', Input::get('claimed_tasks_page', 1))->fragment('claimed-task')->links()}}
@else
<h3>No Claimed Tasks</h3>
@endif
</section>
@stop
示例5: api_get_tracks
public function api_get_tracks()
{
Paginator::setPageName('page');
$tracks = Track::join('albums', 'albums.id', '=', 'tracks.album_id')->join('artists', 'artists.id', '=', 'albums.artist_id')->select(array('tracks.id', 'albums.name as album_name', 'tracks.name as track_name', 'artists.name as artist_name'));
$search = Input::get('search');
if (isset($search)) {
$tracks = $tracks->where('tracks.name', 'like', '%' . $search . '%')->orWhere('albums.name', 'like', '%' . $search . '%')->orWhere('artists.name', 'like', '%' . $search . '%');
}
$tracks = $tracks->paginate(PAGE_SIZE);
//var_dump(DB::getQueryLog());die();
return $tracks;
}