當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Pagination::findCurrentPage方法代碼示例

本文整理匯總了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;
 }
開發者ID:kimkiogora,項目名稱:mth3l3m3nt-framework,代碼行數:9,代碼來源:payload.php

示例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');
 }
開發者ID:piggydoughnut,項目名稱:gitHubWatcher,代碼行數:13,代碼來源:LogsController.php

示例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');
 }
開發者ID:trevorpao,項目名稱:f3cms,代碼行數:13,代碼來源:outfit.php

示例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;
 }
開發者ID:xfra35,項目名稱:fabulog,代碼行數:22,代碼來源:post.php

示例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'));
 }
開發者ID:xfra35,項目名稱:fabulog,代碼行數:24,代碼來源:comment.php

示例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;
 }
開發者ID:theralfbrown,項目名稱:OWASP-mth3l3m3nt-framework,代碼行數:12,代碼來源:webot.php

示例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;
 }
開發者ID:alienwithin,項目名稱:OWASP-mth3l3m3nt-framework,代碼行數:9,代碼來源:ctdb.php


注:本文中的Pagination::findCurrentPage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。