本文整理汇总了PHP中Pagination::findCurrentPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Pagination::findCurrentPage方法的具体用法?PHP Pagination::findCurrentPage怎么用?PHP Pagination::findCurrentPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pagination
的用法示例。
在下文中一共展示了Pagination::findCurrentPage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search_frontend
public function search_frontend($f3)
{
$this->response->data['SUBPART'] = 'payload_list.html';
$page = \Pagination::findCurrentPage();
$term = $f3->get('GET.term');
$search_filter = array('pName LIKE ? OR pDescription LIKE ? OR payload LIKE ? OR pCategory LIKE ? ', "%{$term}%", "%{$term}%", "%{$term}%", "%{$term}%");
$records = $this->resource->paginate($page - 1, 10, $search_filter, array('order' => 'id desc'));
$this->response->data['content'] = $records;
}
示例2: index
/**
* Returns index page for logs with pagination
*/
public function index()
{
$page = \Pagination::findCurrentPage();
$result = $this->model->paginate($page - 1, $this->app->get('limit'), [], ['order' => self::ORDER]);
$pages = new Pagination($result['total'], $result['limit']);
$pages->setTemplate('../views/pagebrowser.html');
$this->app->set('pagebrowser', $pages->serve());
$this->app->set('logs', $result);
echo Template::instance()->render('../views/logs.htm');
}
示例3: do_list
function do_list($f3, $args)
{
$subset = fPress::load_list(Pagination::findCurrentPage(), $args['slug']);
$cate = array();
foreach ($subset['subset'] as &$row) {
$cate[$row->category_id] = rCategory::breadcrumb_categories($row->category_id);
$f3->set('act_link', str_replace('/', '', $cate[$row->category_id]['slug']));
}
$f3->set('pagebrowser', parent::paginate($subset['total'], $subset['limit'], '/presses/' . $args['slug']));
$f3->set('rows', $subset);
$f3->set('cate', $cate);
parent::wrapper('press/list.html', '展覽、文章', '/presses');
}
示例4: getList
/**
* display a list of post entries
* @param \Base $f3
* @param array $params
*/
public function getList(\Base $f3, $params)
{
$this->response->data['SUBPART'] = 'post_list.html';
$page = \Pagination::findCurrentPage();
if ($this->response instanceof \View\Backend) {
// backend view
$records = $this->resource->paginate($page - 1, 5, null, array('order' => 'publish_date desc'));
} else {
// frontend view
$tags = new Tag();
$f3->set('tag_cloud', $tags->tagCloud());
$this->resource->filter('comments', array('approved = ?', 1));
$this->resource->countRel('comments');
$records = $this->resource->paginate($page - 1, 10, array('publish_date <= ? and published = ?', date('Y-m-d'), true), array('order' => 'publish_date desc'));
}
$this->response->data['content'] = $records;
}
示例5: getList
/**
* display list of comments
* @param \Base $f3
* @param array $params
*/
public function getList(\Base $f3, $params)
{
$this->response->data['SUBPART'] = 'comment_list.html';
$filter = array('approved = ?', 0);
// new
if (isset($params['viewtype'])) {
if ($params['viewtype'] == 'published') {
$filter = array('approved = ?', 1);
} elseif ($params['viewtype'] == 'rejected') {
$filter = array('approved = ?', 2);
} elseif (!empty($params['viewtype'])) {
// display all comments for a specified post
$filter = array('post = ?', $params['viewtype']);
}
}
$page = \Pagination::findCurrentPage();
$limit = 10;
$this->response->data['comments'] = $this->resource->paginate($page - 1, $limit, $filter, array('order' => 'datetime desc'));
}
示例6: getSearchResults
/**
* @param $f3
*/
public function getSearchResults($f3)
{
$this->response->data['SUBPART'] = 'webot_list.html';
$page = \Pagination::findCurrentPage();
$term = $f3->get('GET.term');
$search_filter = array('zName LIKE ? zParam LIKE ? ', "%{$term}%", "%{$term}%");
$records = $this->resource->paginate($page - 1, 10, $search_filter, array('order' => 'id desc'));
$this->response->data['content'] = $records;
}
示例7: getSearchResults
public function getSearchResults($f3)
{
$this->response->data['SUBPART'] = 'ctdb_list.html';
$page = \Pagination::findCurrentPage();
$term = $f3->get('GET.term');
$search_filter = array('hosttag LIKE ? OR vulnerableUrl LIKE ? OR referer LIKE ? ', "%{$term}%", "%{$term}%", "%{$term}%");
$records = $this->resource->paginate($page - 1, 10, $search_filter, array('order' => 'id desc'));
$this->response->data['content'] = $records;
}