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


PHP Page::SetPager方法代码示例

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


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

示例1: sp_sql_posts_paged

/**
 * 4
 * @ 处理标签函数
 * @ $tag以字符串方式传入,通过sp_param_lable函数解析为以下变量。例:"cid:1,2;order:post_date desc,listorder desc;"
 * ids:调用指定id的一个或多个数据,如 1,2,3
 * cid:数据所在分类,可调出一个或多个分类数据,如 1,2,3 默认值为全部,在当前分类为:'.$cid.'
 * field:调用post指定字段,如(id,post_title...) 默认全部
 * limit:数据条数,默认值为10,可以指定从第几条开始,如3,8(表示共调用8条,从第3条开始)
 * order:推荐方式(post_date) (desc/asc/rand())
 */
function sp_sql_posts_paged($tag, $pagesize = 20, $pagetpl = '{first}{prev}{liststart}{list}{listend}{next}{last}')
{
    $where = array();
    $tag = sp_param_lable($tag);
    $field = !empty($tag['field']) ? $tag['field'] : '*';
    $limit = !empty($tag['limit']) ? $tag['limit'] : '';
    $order = !empty($tag['order']) ? $tag['order'] : 'post_date';
    //根据参数生成查询条件
    $where['status'] = array('eq', 1);
    $where['post_status'] = array('eq', 1);
    if (isset($tag['cid'])) {
        $where['term_id'] = array('in', $tag['cid']);
    }
    if (isset($tag['ids'])) {
        $where['object_id'] = array('in', $tag['ids']);
    }
    $join = "" . C('DB_PREFIX') . 'posts as b on a.object_id =b.id';
    $join2 = "" . C('DB_PREFIX') . 'users as c on b.post_author = c.id';
    $rs = M("PtermRelationships");
    $totalsize = $rs->alias("a")->join($join)->join($join2)->field($field)->where($where)->count();
    import('Page');
    if ($pagesize == 0) {
        $pagesize = 20;
    }
    $PageParam = C("VAR_PAGE");
    $page = new \Page($totalsize, $pagesize);
    $page->setLinkWraper("li");
    $page->SetPager('default', $pagetpl, array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
    $posts = $rs->alias("a")->join($join)->join($join2)->field($field)->where($where)->order($order)->limit($page->firstRow . ',' . $page->listRows)->select();
    $content['posts'] = $posts;
    $content['page'] = $page->show('default');
    return $content;
}
开发者ID:2flying2,项目名称:IDF-CTF-PLAT,代码行数:43,代码来源:function.php

示例2: sp_sql_qiushis_paged

function sp_sql_qiushis_paged($tag = "", $pagesize = 20, $pagetpl = '{first}{prev}{liststart}{list}{listend}{next}{last}')
{
    $tag = sp_param_lable($tag);
    $field = !empty($tag['field']) ? $tag['field'] : 'b.*';
    $limit = !empty($tag['limit']) ? $tag['limit'] : '';
    $order = !empty($tag['order']) ? $tag['order'] : 'createtime desc';
    $field = "a.cat_name,c.user_login,c.user_nicename," . $field;
    $qiushi_cat_model = M("QiushiCat");
    $join = C('DB_PREFIX') . 'qiushi as b on a.id =b.cid';
    $join2 = C('DB_PREFIX') . 'users as c on c.id =b.uid';
    $where = array("b.status" => 1, "a.status" => 1);
    if (isset($tag['cid'])) {
        $where['cid'] = array('in', $tag['cid']);
    }
    $totalsize = $qiushi_cat_model->alias("a")->join($join)->where($where)->count();
    import('Page');
    $PageParam = C("VAR_PAGE");
    $page = new \Page($totalsize, $pagesize);
    $page->setLinkWraper("li");
    $page->__set("PageParam", $PageParam);
    $pagetpl = '{first}{prev}{liststart}{list}{listend}{next}{last}';
    $page->SetPager('default', $pagetpl, array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
    $qiushis = $qiushi_cat_model->field($field)->alias("a")->join($join)->join($join2)->where($where)->order($order)->limit($page->firstRow . ',' . $page->listRows)->select();
    $return['count'] = $totalsize;
    $return['items'] = $qiushis;
    $return['page'] = $page->show('default');
    return $return;
}
开发者ID:lvxiaolin,项目名称:thinkcfm,代码行数:28,代码来源:function.php

示例3: index

 public function index()
 {
     $this->common();
     $cid = I("get.cid", '0', 'intval');
     $whereArr = empty($cid) ? array("status=1") : array("status=1", "cid={$cid}");
     $sort = I('get.sort', '', 'intval');
     if (!empty($sort)) {
         if ($sort == 1) {
             $order = "post_score ASC";
         } else {
             $order = "post_like DESC,remain ASC";
         }
     } else {
         $order = "listorder ASC,post_date DESC";
     }
     $where = join(" and ", $whereArr);
     import('Page');
     //总数
     $total = $this->model_shop->where($where)->count();
     $Page = new \Page($total, 12);
     $Page->SetPager('Home', '{first}{prev}&nbsp;{liststart}{list}{listend}&nbsp;{next}{last}', array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => " < ", "next" => " > ", "list" => "*", "disabledclass" => ""));
     $list = $this->model_shop->where($where)->order($order)->limit($Page->firstRow . ',' . $Page->listRows)->select();
     $this->assign('list', $list);
     $this->assign('page', $Page->show("Home"));
     $this->assign("cid", $cid);
     $this->display();
 }
开发者ID:noikiy,项目名称:luokeke2,代码行数:27,代码来源:ShopController.class.php

示例4: page

 protected function page($Total_Size = 1, $Page_Size = 0, $Current_Page = 1, $listRows = 6, $PageParam = '', $PageLink = '', $Static = FALSE)
 {
     import('Page');
     if ($Page_Size == 0) {
         $Page_Size = C("PAGE_LISTROWS");
     }
     if (empty($PageParam)) {
         $PageParam = C("VAR_PAGE");
     }
     $Page = new \Page($Total_Size, $Page_Size, $Current_Page, $listRows, $PageParam, $PageLink, $Static);
     $Page->SetPager('default', '{first}{prev}{liststart}{list}{listend}{next}{last}', array("listlong" => "9", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
     return $Page;
 }
开发者ID:lvxiaolin,项目名称:thinkcfm,代码行数:13,代码来源:AppframeController.class.php

示例5: lists

 public function lists()
 {
     $this->Article_common();
     $cid = I("get.cid", 0, 'intval');
     if (empty($cid)) {
         $cid = $this->model_cat->getField("id");
     }
     $fieldArr = array("id", "post_pic", "cid", "post_author", "post_title", "post_like", "post_share", "post_excerpt", "post_date");
     $whereArr = array("cid={$cid}", "status=1");
     $where = join(" and ", $whereArr);
     $field = join(",", $fieldArr);
     $order = "listorder ASC,post_date DESC";
     // 导入分页类
     import('Page');
     //总数
     $total = $this->model_article->where($where)->count();
     $Page = new \Page($total, 5);
     $Page->SetPager('Home', '{first}{prev}&nbsp;{liststart}{list}{listend}&nbsp;{next}{last}', array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => " < ", "next" => " > ", "list" => "*", "disabledclass" => ""));
     $list = $this->model_article->relation(true)->field($field)->where($where)->order($order)->limit($Page->firstRow . ',' . $Page->listRows)->select();
     $Page->SetPager('Phone', '{list}', array("listlong" => "5", 'list' => '*', 'disabledclass' => ''));
     //获取每篇文章的二维码
     for ($i = 0; $i < 5; $i++) {
         if (empty($list[$i])) {
             break;
         }
         $url = 'http://' . $_SERVER['HTTP_HOST'] . U("Portal/Article/info") . "/id/" . $list[$i]['id'];
         $list[$i]['qrpath'] = $this->qrcode($url);
     }
     $this->assign("list", $list);
     $this->assign('page', $Page->show("Home"));
     //手机分页样式
     $this->assign('phonepage', $Page->show('Phone'));
     $this->assign('totalpage', $Page->Total_Pages);
     $this->assign("cid", $cid);
     $this->assign("model_table", "Article");
     $this->display('list');
 }
开发者ID:noikiy,项目名称:luokeke2,代码行数:37,代码来源:ArticleController.class.php

示例6: index

 public function index()
 {
     $qiushi_cat_model = M("QiushiCat");
     $join = C('DB_PREFIX') . 'qiushi as b on a.id =b.cid';
     $join2 = C('DB_PREFIX') . 'users as c on c.id =b.uid';
     $where = array("b.status" => 1, "a.status" => 1);
     $catid = I("get.cat", 0, "intval");
     if (!empty($catid)) {
         $where['a.id'] = $catid;
     }
     $order = array("b.istop" => "desc");
     $sort = I("get.sort", 0, "intval");
     if (empty($sort)) {
         $order['b.createtime'] = "desc";
     } else {
         $sort == 1 ? $order['b.last_comment'] = "desc" : "";
         //按最新回复
         if ($sort == 2) {
             //精华
             $where['b.star'] = array("gt", 0);
             $order['b.createtime'] = "desc";
         }
     }
     $totalsize = $qiushi_cat_model->alias("a")->join($join)->where($where)->count();
     import('Page');
     $PageParam = C("VAR_PAGE");
     $page = new \Page($totalsize, 15);
     $page->setLinkWraper("li");
     $page->__set("PageParam", $PageParam);
     $pagetpl = '{first}{prev}{liststart}{list}{listend}{next}{last}';
     $page->SetPager('default', $pagetpl, array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
     $qiushis = $qiushi_cat_model->field("a.cat_name,b.*,c.user_login,c.user_nicename")->alias("a")->join($join)->join($join2)->where($where)->order($order)->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign("pager", $page->show('default'));
     $qiushi_cats = $qiushi_cat_model->where(array("status" => 1))->order("listorder asc")->select();
     $this->assign("qiushi_cats", $qiushi_cats);
     $catid = I("get.cat", 0, "intval");
     if (!empty($catid)) {
         $qiushi_cat = $qiushi_cat_model->where(array("id" => $catid))->find();
         $this->assign("qiushi_cat", $qiushi_cat);
     }
     $this->assign("qiushis", $qiushis);
     $this->display(":index");
 }
开发者ID:noikiy,项目名称:cmfx,代码行数:43,代码来源:IndexController.class.php

示例7: index

 public function index()
 {
     $qiushi_cat_model = M("QiushiCat");
     $join = C('DB_PREFIX') . 'qiushi as b on a.id =b.cid';
     $join2 = C('DB_PREFIX') . 'users as c on c.id =b.uid';
     $where = array("b.uid" => get_current_userid());
     $totalsize = $qiushi_cat_model->alias("a")->join($join)->where($where)->count();
     import('Page');
     $PageParam = C("VAR_PAGE");
     $page = new \Page($totalsize, 10);
     $page->setLinkWraper("li");
     $page->__set("PageParam", $PageParam);
     $pagetpl = '{first}{prev}{liststart}{list}{listend}{next}{last}';
     $page->SetPager('default', $pagetpl, array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
     $qiushi_cats = $qiushi_cat_model->where(array("status" => 1))->select();
     $this->assign("qiushi_cats", $qiushi_cats);
     $join = C('DB_PREFIX') . 'qiushi as b on a.id =b.cid';
     $join2 = C('DB_PREFIX') . 'users as c on c.id =b.uid';
     $qiushis = $qiushi_cat_model->field("a.cat_name,b.*,c.user_login,c.user_nicename")->alias("a")->join($join)->join($join2)->where($where)->order("b.createtime desc")->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign("pager", $page->show('default'));
     $this->assign("qiushis", $qiushis);
     $this->display();
 }
开发者ID:lvxiaolin,项目名称:thinkcfm,代码行数:23,代码来源:UserController.class.php

示例8: sp_content_page

function sp_content_page($content, $pagetpl = '{first}{prev}{liststart}{list}{listend}{next}{last}')
{
    $contents = explode('_ueditor_page_break_tag_', $content);
    $totalsize = count($contents);
    import('Page');
    $pagesize = 1;
    $PageParam = C("VAR_PAGE");
    $page = new \Page($totalsize, $pagesize);
    $page->setLinkWraper("li");
    $page->SetPager('default', $pagetpl, array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
    $content = $contents[$page->firstRow];
    $data['content'] = $content;
    $data['page'] = $page->show('default');
    return $data;
}
开发者ID:noikiy,项目名称:luokeke2,代码行数:15,代码来源:function.php

示例9: page

 /**
  * 分页
  * @param type $Total_Size
  * @param type $Page_Size
  * @param type $Current_Page
  * @param type $listRows
  * @param type $PageParam
  * @param type $PageLink
  * @param type $Static
  * @return \Page 
  */
 protected function page($Total_Size = 1, $Page_Size = 0, $Current_Page = 1, $listRows = 6, $PageParam = '', $PageLink = '', $Static = FALSE)
 {
     import('Page');
     if ($Page_Size == 0) {
         $Page_Size = C("PAGE_LISTROWS");
     }
     if (empty($PageParam)) {
         $PageParam = C("VAR_PAGE");
     }
     $Page = new Page($Total_Size, $Page_Size, $Current_Page, $listRows, $PageParam, $PageLink, $Static);
     $Page->SetPager('Admin', '共有{recordcount}条信息&nbsp;{pageindex}/{pagecount}&nbsp;{first}{prev}&nbsp;{liststart}{list}{listend}&nbsp;{next}{last}&nbsp;转到{jump}页', array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
     return $Page;
 }
开发者ID:BGCX262,项目名称:ztoa-svn-to-git,代码行数:24,代码来源:BaseAction.class.php

示例10: page

function page($total, $size = 0, $number = 0, $config = array())
{
    static $_pageCache = array();
    $cacheIterateId = to_guid_string(func_get_args());
    if (isset($_pageCache[$cacheIterateId])) {
        return $_pageCache[$cacheIterateId];
    }
    $defaultConfig = array('number' => $number, 'param' => C("VAR_PAGE"), 'rule' => '', 'isrule' => false, 'tpl' => '', 'tplconfig' => array('listlong' => 6, 'listsidelong' => 2, "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
    $cfg = array('listlong' => 6, 'listsidelong' => 2, 'list' => '*', 'currentclass' => 'current', 'first' => '&laquo;', 'prev' => '&#8249;', 'next' => '&#8250;', 'last' => '&raquo;', 'more' => '...', 'disabledclass' => 'disabled', 'jump' => '', 'jumpplus' => '', 'jumpaction' => '', 'jumplong' => 50);
    if (!empty($config) && is_array($config)) {
        $defaultConfig = array_merge($defaultConfig, $config);
    }
    $defaultConfig['size'] = $size ? $size : C("PAGE_LISTROWS");
    foreach ($cfg as $key => $value) {
        if (isset($defaultConfig[$key])) {
            $defaultConfig['tplconfig'][$key] = isset($defaultConfig[$key]) ? $defaultConfig[$key] : $value;
        }
    }
    import('Page');
    if ($defaultConfig['isrule'] && empty($defaultConfig['rule'])) {
        $URLRULE = $GLOBALS['URLRULE'] ? $GLOBALS['URLRULE'] : URLRULE;
        $PageLink = array();
        if (!is_array($URLRULE)) {
            $URLRULE = explode("~", $URLRULE);
        }
        $PageLink['index'] = $URLRULE['index'] ? $URLRULE['index'] : $URLRULE[0];
        $PageLink['list'] = $URLRULE['list'] ? $URLRULE['list'] : $URLRULE[1];
        $defaultConfig['rule'] = $PageLink;
    } else {
        if ($defaultConfig['isrule'] && !is_array($defaultConfig['rule'])) {
            $URLRULE = explode('|', $defaultConfig['rule']);
            $PageLink = array();
            $PageLink['index'] = $URLRULE[0];
            $PageLink['list'] = $URLRULE[1];
            $defaultConfig['rule'] = $PageLink;
        }
    }
    $Page = new Page($total, $defaultConfig['size'], $defaultConfig['number'], $defaultConfig['list'], $defaultConfig['param'], $defaultConfig['rule'], $defaultConfig['isrule']);
    $Page->SetPager('default', $defaultConfig['tpl'], $defaultConfig['tplconfig']);
    $_pageCache[$cacheIterateId] = $Page;
    return $_pageCache[$cacheIterateId];
}
开发者ID:NeilFee,项目名称:vipxinbaigo,代码行数:42,代码来源:~runtime.php

示例11: pointlist

 public function pointlist()
 {
     $order = 'post_date DESC';
     $whereAnds = array("uid={$this->userid}");
     if (IS_POST) {
         if (!empty($_POST['control_date'])) {
             $get = strtotime($_POST['control_date']);
             array_push($whereAnds, "post_date >= {$get}");
         }
         if (!empty($_POST['control_date2'])) {
             $get = strtotime($_POST['control_date2']);
             array_push($whereAnds, "post_date <= {$get}");
         }
         if (!empty($_POST['TypeID'])) {
             if ($_POST['TypeID'] == 1) {
                 array_push($whereAnds, "gid = 0");
             } elseif ($_POST['TypeID'] == 2) {
                 array_push($whereAnds, "gid > 0");
             } else {
                 array_push($whereAnds, "gid >= 0");
             }
         }
     }
     $where = join(" and ", $whereAnds);
     $count = $this->exchange->where($where)->count();
     import('Page');
     $Page = new \Page($count, 8);
     $Page->SetPager('Home', '{first}{prev}&nbsp;{liststart}{list}{listend}&nbsp;{next}{last}', array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => " < ", "next" => " > ", "list" => "*", "disabledclass" => ""));
     $list = $this->exchange->relation(true)->where($where)->limit($Page->firstRow, $Page->listRows)->order($order)->select();
     $this->assign("list", $list);
     $this->assign('page', $Page->show("Home"));
     $this->display(':pointlist');
 }
开发者ID:noikiy,项目名称:luokeke2,代码行数:33,代码来源:CenterController.class.php

示例12: _list

 /**
  * 列表数据
  * @param string  $model 	        模型
  * @param bool 	  $siteCharge  是否根据站点判断,默认为false
  * @param array	  $extra	       额外字段,自带字段:id,post_pic,post_title,post_url
  * @param array	  $extraWhere  查询条件
  * @param int	  $count	        分页条数,默认:16条
  */
 public function _list($model, $siteCharge = false, $extra = array(), $extraWhere = array(), $count = 16, $order = '')
 {
     $fieldArr = array("id", "post_pic", "post_title", "post_url");
     $whereArr = array_merge($extraWhere, array("status=1"));
     if ($siteCharge) {
         array_push($whereArr, "site_id={$this->siteId}");
     }
     if (!empty($extra)) {
         $fieldArr = array_merge($fieldArr, $extra);
     }
     $where = join(" and ", $whereArr);
     $field = join(",", $fieldArr);
     $order = empty($order) ? "listorder ASC,post_date DESC" : $order;
     // 导入分页类
     import('Page');
     //总数
     $total = $model->where($where)->count();
     $Page = new \Page($total, $count);
     $Page->SetPager('Home', '{first}{prev}&nbsp;{liststart}{list}{listend}&nbsp;{next}{last}', array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => " < ", "next" => " > ", "list" => "*", "disabledclass" => ""));
     $list = $model->field($field)->where($where)->order($order)->limit($Page->firstRow . ',' . $Page->listRows)->select();
     $Page->SetPager('Phone', '{list}', array("listlong" => "5", 'list' => '*', 'disabledclass' => ''));
     //手机分页样式
     $this->assign('phonepage', $Page->show('Phone'));
     $this->assign("list", $list);
     $this->assign('page', $Page->show("Home"));
 }
开发者ID:noikiy,项目名称:luokeke2,代码行数:34,代码来源:IndexController.class.php

示例13: page

/**
* 分页输出
* @param type $Total_Size 总记录数
* @param type $Page_Size 分页大小
* @param type $Current_Page 当前页
* @param type $listRows 显示页数
* @param type $PageParam 分页参数
* @param type $PageLink 分页链接
* @param type $Static 是否(伪)静态
* @return \Page 
* 其他说明 :当开启静态的时候 $PageLink 传入的是数组,数组格式
* array(
 "index"=>"http://www.85zu.com/192.html",//这种是表示当前是首页,无需加分页1
 "list"=>"http://www.85zu.com/192-{page}.html",//这种表示分页非首页时启用
 )
*/
function page($Total_Size = 1, $Page_Size = 0, $Current_Page = 1, $listRows = 6, $PageParam = '', $PageLink = '', $Static = FALSE, $TP = "")
{
    static $_pageCache = array();
    $cacheIterateId = md5($Total_Size . $Page_Size . $Current_Page . $listRows . $PageParam);
    if (isset($_pageCache[$cacheIterateId])) {
        return $_pageCache[$cacheIterateId];
    }
    import('Page');
    if ($Page_Size == 0) {
        $Page_Size = C("PAGE_LISTROWS");
    }
    if (empty($PageParam)) {
        $PageParam = C("VAR_PAGE");
    }
    //生成静态,需要传递一个常量URLRULE,来生成对应规则
    if (empty($PageLink) && $Static == true) {
        $P = explode("~", URLRULE);
        $PageLink = array();
        $PageLink['index'] = $P[0];
        $PageLink['list'] = $P[1];
    }
    if (empty($TP)) {
        $TP = '共有{recordcount}条信息&nbsp;{pageindex}/{pagecount}&nbsp;{first}{prev}&nbsp;{liststart}{list}{listend}&nbsp;{next}{last}';
    }
    $Page = new Page($Total_Size, $Page_Size, $Current_Page, $listRows, $PageParam, $PageLink, $Static);
    $Page->SetPager('default', $TP, array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
    $_pageCache[$cacheIterateId];
    return $Page;
}
开发者ID:BGCX262,项目名称:ztoa-svn-to-git,代码行数:45,代码来源:common.php

示例14: page

function page($Total_Size = 1, $Page_Size = 0, $Current_Page = 1, $listRows = 6, $PageParam = '', $PageLink = '', $Static = FALSE)
{
    import('Page');
    if ($Page_Size == 0) {
        $Page_Size = C("PAGE_LISTROWS");
    }
    if (empty($PageParam)) {
        $PageParam = C("VAR_PAGE");
    }
    $Page = new \Page($Total_Size, $Page_Size, $Current_Page, $listRows, $PageParam, $PageLink, $Static);
    //	$Page->setLinkWraper('li');
    //	$Page->SetPager('home', '<ul class="pagination">{first}{prev}{liststart}{list}{listend}{next}{last} <div class="form">
    //								 		<span class="txt">到第</span>
    //								 		{jump}
    //								 		<span class="txt">页</span>
    //								 		<span class="btn btn-sm submit">确定</span>
    //								 	</div></ul>', array("listlong" => "9", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
    //$Page->setPager('home' , 'Tpl' => '', 'Config' => array()));
    $Page->SetPager('default', '<div class="item-page"><ul class="pagination"><li class="prev disabled">{prev}</li><li>{list}</li><li>{next}</li></ul>{jump}</div>', array("listlong" => "6", "first" => "首页", "last" => "尾页", "prev" => "<", "next" => ">", "list" => "*", "jump" => "input"));
    return $Page;
}
开发者ID:kmlzh1983,项目名称:diamond,代码行数:21,代码来源:extend.php

示例15: sp_sql_goods_paged

/**
 * 商品列表,带page
 * @ 处理标签函数
 * @ $tag以字符串方式传入,通过sp_param_lable函数解析为以下变量。例:"order:add_time desc,update_time desc;"
 * ids:调用指定id的一个或多个数据,如 1,2,3
 * field:调用goods指定字段,如(goods_id,goods_name...) 默认全部
 * limit:数据条数,默认值为10,可以指定从第几条开始,如3,8(表示共调用8条,从第3条开始)
 * order:推荐方式(add_time) (desc/asc/rand())
 */
function sp_sql_goods_paged($tag, $pagesize = 20)
{
    $where = array();
    $tag = sp_param_lable($tag);
    $field = !empty($tag['field']) ? $tag['field'] : '*';
    $limit = !empty($tag['limit']) ? $tag['limit'] : '';
    $order = !empty($tag['order']) ? $tag['order'] : 'add_time';
    //根据参数生成查询条件
    $where['goods_state'] = array('eq', 1);
    if (isset($tag['cid'])) {
        $where['term_id'] = array('in', $tag['cid']);
    }
    if (isset($tag['keywords'])) {
        $where['goods_name'] = array('like', "%" . $tag['keywords'] . "%");
    }
    if (isset($tag['ids'])) {
        $where['goods_id'] = array('in', $tag['ids']);
    }
    $goods = D("Goods");
    $totalsize = $goods->field($field)->where($where)->count();
    import('Page');
    if ($pagesize == 0) {
        $pagesize = 20;
    }
    $PageParam = C("VAR_PAGE");
    $page = new Page($totalsize, $pagesize);
    $page->setLinkWraper("li");
    $page->__set("PageParam", $PageParam);
    $page->SetPager('default', '<div class="page">{prev}&nbsp;&nbsp;{list}&nbsp;&nbsp;{listend}&nbsp;&nbsp;{next}</div>', array("listlong" => "6", "first" => "首页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
    $list = $goods->field($field)->where($where)->order($order)->limit($page->firstRow . ',' . $page->listRows)->select();
    $content['goods'] = $list;
    $content['count'] = $totalsize;
    $content['page'] = $page->show('default');
    return $content;
}
开发者ID:it114,项目名称:public,代码行数:44,代码来源:function.php


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