本文整理汇总了PHP中Illuminate\Pagination\Paginator::appends方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::appends方法的具体用法?PHP Paginator::appends怎么用?PHP Paginator::appends使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Pagination\Paginator
的用法示例。
在下文中一共展示了Paginator::appends方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paginatedCollection
public function paginatedCollection(Paginator $paginator, $transformer = null, $resourceKey = null)
{
$paginator->appends(\Request::query());
$resource = new Collection($paginator->getCollection(), $this->getTransformer($transformer), $resourceKey);
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return $this->manager->createData($resource)->toArray();
}
示例2: preparePagination
/**
* Prepare query for pagination
*
* @return $this
*/
protected function preparePagination()
{
$this->setQuerySortable();
// set paginator
$this->paginator = $this->getQuery()->paginate($this->getPerPage());
$this->paginator->appends(Request::except('ajax'));
return $this;
}
示例3: links
/**
* @param string $view
*
* @return mixed
*/
public function links($view = null)
{
if ($this->limit) {
if ($this->hash != '')
return $this->paginator->appends($this->url->remove('page')->getArray())->fragment($this->hash)->render($view);
else
return $this->paginator->appends($this->url->remove('page')->getArray())->render($view);
}
}
示例4: links
/**
* @param string $view
*
* @return mixed
*/
public function links($view = null)
{
if ($this->limit) {
if ($this->hash != '') {
$links = $this->paginator->appends($this->url->remove('page' . $this->cid)->getArray())->fragment($this->hash)->render($view);
} else {
$links = $this->paginator->appends($this->url->remove('page' . $this->cid)->getArray())->render($view);
}
return str_replace('/?', '?', $links);
}
}
示例5:
/**
* Flexible pagination links.
*
* @param Paginator $data
* @return mixed
*/
function pagination_links(Paginator $data)
{
if ($query = request()->query()) {
$query = array_except($query, 'page');
return $data->appends($query)->links();
}
return $data->links();
}
示例6: paginate
/**
* Use a custom pagination style.
*/
public function paginate(Paginator $model) : string
{
return with(new SemanticUIPagination($model->appends($this->request->query())))->render();
}