当前位置: 首页>>代码示例>>PHP>>正文


PHP Pager::url方法代码示例

本文整理汇总了PHP中Pager::url方法的典型用法代码示例。如果您正苦于以下问题:PHP Pager::url方法的具体用法?PHP Pager::url怎么用?PHP Pager::url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pager的用法示例。


在下文中一共展示了Pager::url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_list

 public function action_list()
 {
     $cid = Arr::get($_GET, 'cid');
     $where = array();
     $where['cid'] = $cid;
     $where['status'] = 'open';
     $where['ORDER'] = 'id DESC';
     $where = array_filter($where);
     $m_article = Model::factory('article', 'cms');
     $total = $m_article->count($where);
     $pager = new Pager($total, 10);
     $list = $m_article->select($pager->offset, $pager->size, $where)->as_array();
     $m_category = Model::factory('category', 'cms');
     $cat_list = $m_category->getAll()->as_array('id', 'name');
     foreach ($list as &$item) {
         $item['cat_name'] = isset($cat_list[$item['cid']]) ? $cat_list[$item['cid']] : '';
     }
     unset($item);
     if (isset($_GET['get_next_page'])) {
         $content = View::factory('article/list_incr');
         $content->list = $list;
         $next_page = $pager->next_page ? $pager->url($pager->next_page, array('cid' => $cid, 'get_next_page' => 'ajax')) : '';
         header('Content-Type: application/json; charset=utf-8');
         $ret = array('content' => (string) $content, 'next_page' => $next_page);
         echo json_encode($ret);
         exit;
     }
     $this->content = View::factory('article_list');
     $this->content->list = $list;
     $this->content->pager = $pager->render('common/pager');
     $this->content->next_page = $pager->next_page ? $pager->url($pager->next_page, array('cid' => $cid, 'get_next_page' => 'ajax')) : '';
 }
开发者ID:andygoo,项目名称:cms,代码行数:32,代码来源:Article.php

示例2: action_grid

 public function action_grid()
 {
     $where = array();
     $where['ORDER'] = 'id DESC';
     $q = Arr::get($_GET, 'q', '');
     if (!empty($q)) {
         $where['file_src'] = array('like' => "%{$q}%");
     }
     $m_upload = Model::factory('upload');
     $total = $m_upload->count($where);
     $pager = new Pager($total, 20);
     $list = $m_upload->select($pager->offset, $pager->size, $where)->as_array();
     if ($this->auto_render !== TRUE) {
         $this->content = View::factory('upload_grid_increment');
         $this->content->list = $list;
         $nexturl = '';
         if ($pager->next_page) {
             $nexturl = $pager->url($pager->next_page);
         }
         header('Content-Type: application/json; charset=utf-8');
         $ret = array('content' => (string) $this->content, 'nexturl' => $nexturl);
         echo json_encode($ret);
         exit;
     } else {
         $this->content = View::factory('upload_grid');
     }
     $this->content->list = $list;
     $this->content->pager = $pager;
     echo $this->content;
     exit;
 }
开发者ID:andygoo,项目名称:admin,代码行数:31,代码来源:Upload.php

示例3: action_recentbid

 public function action_recentbid()
 {
     $logid = Arr::get($_GET, 'logid');
     $item_id = Arr::get($_GET, 'id');
     $where = array('id' => array('<' => $logid), 'item_id' => $item_id, 'ORDER' => 'id desc');
     $size = 5;
     $m_bidlog = Model::factory('bidlog', 'paimai');
     $total = $m_bidlog->count($where);
     $pager = new Pager($total, $size);
     $list_bidlog = $m_bidlog->select($pager->offset, $pager->size, $where)->as_array();
     $next_page = $pager->next_page ? $pager->url($pager->next_page) : '';
     $content = View::factory('auction/bidlog');
     $content->list_bidlog = $list_bidlog;
     header('Content-Type: application/json; charset=utf-8');
     $ret = array('content' => (string) $content, 'next_page' => $next_page);
     echo json_encode($ret);
     exit;
 }
开发者ID:andygoo,项目名称:cms,代码行数:18,代码来源:Auction.php


注:本文中的Pager::url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。