本文整理汇总了PHP中Page::setConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::setConfig方法的具体用法?PHP Page::setConfig怎么用?PHP Page::setConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page::setConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
import('ORG.Util.Page');
$m = M("Good");
$count = $m->count();
// 查询满足要求的总记录数
$Page = new Page($count, 12);
// 实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', '条记录');
$Page->setConfig('theme', '<li><a>%totalRow% %header%</a></li> <li>%upPage%</li> <li>%downPage%</li> <li>%first%</li> <li>%prePage%</li> <li>%linkPage%</li> <li>%nextPage%</li> <li>%end%</li> ');
//(对thinkphp自带分页的格式进行自定义)
$show = $Page->show();
// 分页显示输出
$result = $m->limit($Page->firstRow . ',' . $Page->listRows)->select();
for ($i = 0; $i < count($result); $i++) {
$menu_id = $result[$i]["menu_id"];
$result[$i]["menu"] = R("Api/Api/getmenuvalue", array($menu_id));
}
$menu = R("Api/Api/getarraymenu");
$this->assign("menu", $menu);
$this->assign("addmenu", $menu);
$this->assign("page", $show);
// 赋值分页输出
$this->assign("result", $result);
$this->display();
}
示例2: index
function index()
{
// print_r($_SESSION);
// exit();
$donate_model = M('donate');
import('ORG.Util.Page');
$pagesize = 17;
$count = $donate_model->where('userid=' . $_SESSION['userid'])->count();
// 查询满足要求的总记录数
$Page = new Page($count, $pagesize);
// 实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', '条赠送金额信息');
$Page->setConfig('prev', '上一页');
$Page->setConfig('next', '下一页');
$Page->setConfig('theme', '共查询出%totalRow%%header% 第%nowPage%页|共%totalPage% 页 %upPage% %first% %prePage% %linkPage% %nextPage% %end% %downPage%');
$show = $Page->show();
// 分页显示输出
// 进行分页数据查询 注意limit方法的参数要使用Page类的属性
$list = $donate_model->where('userid=' . $_SESSION['userid'])->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
$list = $this->formatfield($list);
$this->assign('list', $list);
// 赋值数据集
$this->assign('page', $show);
// 赋值分页输出
$this->display();
}
示例3: index
public function index()
{
parent::userauth2(12);
$co = M('competence');
$keyword = I('get.keyword', '', 'htmlspecialchars');
import('ORG.Util.Page');
// 导入分页类
$where['Sid&Cname'] = array('0', array('LIKE', "%{$keyword}%"), '_multi' => true);
//多条件查询
$count = $co->where($where)->count();
//总记录数
$Page = new Page($count, 4);
//实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', '条记录');
$Page->setConfig('prev', '<img src="__IMAGE__/prev.gif" border="0" title="上一页" />');
$Page->setConfig('next', '<img src="__IMAGE__/next.gif" border="0" title="下一页" />');
$Page->setConfig('first', '<img src="__IMAGE__/first.gif" border="0" title="第一页" />');
$Page->setConfig('last', '<img src="__IMAGE__/last.gif" border="0" title="最后一页" />');
$show = $Page->show();
//分页显示输出
$volist = $co->where($where)->order('Dtime')->limit($Page->firstRow . ',' . $Page->listRows)->select();
$sidlist = $co->where('Sid<>0')->order('Dtime')->select();
$this->assign('volist', $volist);
$this->assign('sidlist', $sidlist);
$this->assign('page', $show);
$this->assign('keyword', $keyword);
$this->co = $count;
$this->display();
}
示例4: ip
public function ip()
{
parent::userauth2(21);
$keyword = I('get.keyword', '', 'htmlspecialchars');
$ip = D('Ip');
import('ORG.Util.Page');
// 导入分页类
if ($keyword != '') {
$where['Ip'] = $keyword;
} else {
$where['Ip'] = '';
}
$count = $ip->where($where)->count();
//总记录数
$Page = new Page($count, 15);
//实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', '条记录');
$Page->setConfig('prev', '<img src="__IMAGE__/prev.gif" border="0" title="上一页" />');
$Page->setConfig('next', '<img src="__IMAGE__/next.gif" border="0" title="下一页" />');
$Page->setConfig('first', '<img src="__IMAGE__/first.gif" border="0" title="第一页" />');
$Page->setConfig('last', '<img src="__IMAGE__/last.gif" border="0" title="最后一页" />');
$show = $Page->show();
//分页显示输出
$volist = $ip->relation(true)->where($where)->order('Dtime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
$this->assign('volist', $volist);
$this->assign('page', $show);
//输出分页
$this->assign('keyword', $keyword);
$this->co = $count;
$this->display();
}
示例5: admin_user_list
public function admin_user_list()
{
$admin = $this->is_admin_authed();
if (empty($admin)) {
redirect(__APP__ . '/admin/login.html');
}
$user = D('User');
$user_all = $user->get_user_list();
$user_count = count($user_all);
import('ORG.Util.Page');
// 导入分页类
$page = new Page($user_count, '', '', 'admin/user_list');
$page->setConfig('first', '首页');
$page->setConfig('prev', '上一页');
$page->setConfig('next', '下一页');
$page->setConfig('last', '末页');
$page->setConfig('theme', '%first% %prePage% %linkPage% %nextPage% %end%');
$show = $page->show();
// 分页显示输出
$offset = I('page') ? (I('page') - 1) * $page->listRows : 0;
$user_list = $user->get_user_list($offset, $page->listRows);
$this->assign('page', $show);
// 赋值分页输出
$this->assign('user_list', $user_list);
// 赋值数据集
$this->assign('admin', $admin);
$this->display();
}
示例6: index
/**
* 最新资讯
*/
public function index()
{
// 渲染TDK
$this->tdk(4);
// 导航高亮
$this->assign('highline', 4);
// 渲染导航条
$this->navigation();
// 渲染右边悬浮框
$this->right();
// 资讯分类
$category = M('NewsCategory')->order("add_time ASC")->select();
if ($category) {
$id = isset($_GET['category']) ? intval($_GET['category']) : $category[0]['id'];
if (!M('NewsCategory')->where(array('id' => $id))->count()) {
$this->redirect('/news/index?category=' . $category[0]['id']);
}
Load('extend');
import('ORG.Util.Page');
$news = M('News');
$count = $news->where(array('category_id' => $id))->count();
$page = new Page($count, 10);
$page->setConfig('theme', "共 %totalRow% %header% %nowPage%/%totalPage%页 %upPage% %downPage% %first% %prePage% %linkPage% %nextPage% %end%");
$page->setConfig('header', '篇资讯');
$show = $page->show();
$newsLists = $news->where(array('category_id' => $id))->order("add_time DESC")->limit($page->firstRow, $page->listRows)->select();
$this->assign('newsLists', $newsLists);
$this->assign('count', ceil($count / 10));
$this->assign('page', $show);
$this->assign('category', $category);
}
$this->assign('id', $id);
$this->display();
}
示例7: index
public function index()
{
//自定义
$Form = M('Form');
import("@.ORG.Page");
//导入分页类
$count = $Form->count();
//计算总数
$p = new Page($count, 5);
$list = $Form->limit($p->firstRow . ',' . $p->listRows)->order('id desc')->select();
//$p->firstRow 当前页开始记录的下标,$p->listRows 每页显示记录数
//一般定义分页样式 通过分页对象的setConfig定义其config属性;
/*
默认值为$config = array('header'=>'条记录','prev'=>'上一页','next'=>'下一页','first'=>'第一页','last'=>'最后一页',
'theme'=>' %totalRow% %header% %nowPage%/%totalPage% 页 %upPage% %downPage% %first% %prePage% %linkPage% %nextPage% %end%');
修改显示的元素的话设置theme就行了,可对其元素加class
*/
$p->setConfig('header', '条数据');
$p->setConfig('prev', "<");
$p->setConfig('next', '>');
$p->setConfig('first', '<<');
$p->setConfig('last', '>>');
$page = $p->show();
//分页的导航条的输出变量
$this->assign("page", $page);
$this->assign("list", $list);
//数据循环变量
$this->display();
}
示例8: index
public function index()
{
parent::userauth2(60);
$sid = I('get.sid', '');
$menu = D('Dmenu');
import('ORG.Util.Page');
// 导入分页类
if ($sid != '') {
$where['Sid'] = $sid;
} else {
$where['Sid'] = 0;
}
$count = $menu->where($where)->count();
//总记录数
$Page = new Page($count, 15);
//实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', '条记录');
$Page->setConfig('prev', '<img src="__IMAGE__/prev.gif" border="0" title="上一页" />');
$Page->setConfig('next', '<img src="__IMAGE__/next.gif" border="0" title="下一页" />');
$Page->setConfig('first', '<img src="__IMAGE__/first.gif" border="0" title="第一页" />');
$Page->setConfig('last', '<img src="__IMAGE__/last.gif" border="0" title="最后一页" />');
$show = $Page->show();
//分页显示输出
$volist = $menu->relation(true)->where($where)->order('Sortid asc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
$list = $menu->where('Sid = 0')->order('Sortid asc')->select();
$this->assign('volist', $volist);
$this->assign('list', $list);
$this->assign('sid', $sid);
$this->assign('page', $show);
//输出分页
$this->co = $count;
$this->display('System/dmenu');
}
示例9: pageInit
protected function pageInit($count, $header = '条记录', $row = PDM_LIMIT, $url = '')
{
import("@.Rover.Page");
$page = new Page($count, $row);
if ($url != '') {
$page->url = $url;
}
$page->setConfig('header', $header);
$page->setConfig('first', '首页');
$page->setConfig('last', '尾页');
$page->setConfig('theme', '<li class="previous">%upPage%</li><li class="next"> %downPage%</li>');
$this->assign('page', $page->show());
//开始记录分页序号 S
if ($page->nowPage == 1) {
$current_page = 0;
$row = 0;
} else {
$row = $page->listRows;
$current_page = $page->nowPage;
}
$this->assign('page_now', $current_page);
$this->assign('page_row', $row);
//开始记录分页序号 E
return $page;
}
示例10: index
function index()
{
// print_r($_SESSION);
// exit();
if (isset($_GET['id'])) {
$id = $_GET['id'];
$_SESSION['userid'] = $id;
} else {
$id = $_session['userid'];
}
// 1代表 已过期 2代表 本月过期 3代表 3个月未使用
$user_model = M('users');
if ($id == 1) {
// code...
$where = "expirydate<=" . time();
} else {
if ($id == 2) {
// 本月过期
$time = strtotime(date('Y-m-01 00:00:00'), time());
$where = "expirydate>=" . $time . "and expirydate<=" . time();
} else {
if ($id == 3) {
$time = time() - 90 * 24 * 60 * 60;
$where = "lastusetime<=" . $time;
} else {
$where = "banlance<='0' and limitflag = 0";
}
}
}
import('ORG.Util.Page');
if ($_SESSION['power'] == 1) {
$header = "条用户信息";
$count = $user_model->where($where)->count();
// 查询满足要求的总记录数
$Page = new Page($count, $pagesize);
// 实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', $header);
$Page->setConfig('prev', '上一页');
$Page->setConfig('next', '下一页');
$Page->setConfig('theme', '共查询出%totalRow%%header% 第%nowPage%页|共%totalPage% 页 %upPage% %first% %prePage% %linkPage% %nextPage% %end% %downPage%');
$show = $Page->show();
// 分页显示输出
$userdata = $user_model->where($where)->order('registedate')->limit($Page->firstRow . ',' . $Page->listRows)->select();
$this->assign('page', $show);
// 赋值分页输出
} else {
$sql = "select * from cb_users where phonenum in (select bindtel from cb_cards where ownid=" . $_SESSION['accountid'] . " or subownid=" . $_SESSION['accountid'] . ") and " . $where;
$userdata = $user_model->query($sql);
}
$userdata = $this->formatarrfield($userdata);
$this->assign("userdata", $userdata);
$this->assign('timer', $this->getTime());
$this->display();
}
示例11: paging
public function paging($obj, $where = '', $pagesize = '12')
{
import("ORG.Util.Page");
$count = $obj->where($where)->count();
$pageobj = new Page($count, $pagesize);
$pageobj->setConfig('header', '条');
$pageobj->setConfig('prev', "<");
$pageobj->setConfig('next', '>');
$pageobj->setConfig('first', '<<');
$pageobj->setConfig('last', '>>');
return $pageobj;
}
示例12: _pager
/**
* 前台分页统一
*/
protected function _pager($count, $pagesize)
{
$pager = new Page($count, $pagesize);
$pager->rollPage = 5;
$pager->setConfig('header', '条记录');
$pager->setConfig('prev', '上一页');
$pager->setConfig('next', '下一页');
$pager->setConfig('first', '第一页');
$pager->setConfig('last', '最后一页');
$pager->setConfig('theme', '%upPage% %first% %linkPage% %end% %downPage%');
return $pager;
}
示例13: index
function index()
{
import('ORG.Util.Page');
$pagesize = 17;
$donate_model = M('donate');
if ($_SESSION['power'] == 1) {
$count = $donate_model->where($data)->count();
// 查询满足要求的总记录数
$Page = new Page($count, $pagesize);
// 实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', '条赠送金额信息');
$Page->setConfig('prev', '上一页');
$Page->setConfig('next', '下一页');
$Page->setConfig('theme', '共查询出%totalRow%%header% 第%nowPage%页|共%totalPage% 页 %upPage% %first% %prePage% %linkPage% %nextPage% %end% %downPage%');
$show = $Page->show();
// 分页显示输出
//进行分页数据查询 注意limit方法的参数要使用Page类的属性
$list = $donate_model->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
$list = $this->getusername($list);
$list = $this->formatfield($list);
$this->assign('list', $list);
// 赋值数据集
$this->assign('page', $show);
// 赋值分页输出
$this->display();
// 输出模板
} else {
//$_SESSION['accountid']=19;
$sql = "select count(id) from cb_donate where userid in (select id from cb_users where phonenum in(select bindtel from cb_cards where subownid =" . $_SESSION['accountid'] . " or ownid=" . $_SESSION['accountid'] . "))";
$arr = $donate_model->query($sql);
$count = $arr[0]['count'];
$Page = new Page($count, $pagesize);
// 实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', $header);
$Page->setConfig('prev', '上一页');
$Page->setConfig('next', '下一页');
$Page->setConfig('theme', '共查询出%totalRow%%header% 第%nowPage%页|共%totalPage% 页 %upPage% %first% %prePage% %linkPage% %nextPage% %end% %downPage%');
$show = $Page->show();
// 分页显示输出
// 进行分页数据查询 注意limit方法的参数要使用Page类的属性
$sql = "select * from cb_donate where userid in (select id from cb_users where phonenum in(select bindtel from cb_cards where subownid =" . $_SESSION['accountid'] . " or ownid=" . $_SESSION['accountid'] . "))";
$sql = $sql . " limit " . $Page->listRows . " offset " . $Page->firstRow;
$list = $donate_model->query($sql);
$list = $this->getusername($list);
$list = $this->formatfield($list);
$this->assign('list', $list);
// 赋值数据集
$this->assign('page', $show);
// 赋值分页输出
$this->display();
}
}
示例14: index
function index()
{
$account = M('account');
$nav = $this->infinite($account->field('id,loginname,ownid')->order('id ASC')->select(), $_SESSION['accountid']);
$this->assign('nav', $nav);
if ($_SESSION['power'] == 1) {
$log_model = M('log');
import('ORG.Util.Page');
$header = "条操作日志";
$pagesize = 16;
$count = $log_model->count();
// 查询满足要求的总记录数
//print_r($count);
$Page = new Page($count, $pagesize);
// 实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', $header);
$Page->setConfig('prev', '上一页');
$Page->setConfig('next', '下一页');
$Page->setConfig('theme', '共查询出%totalRow%%header% 第%nowPage%页|共%totalPage% 页 %upPage% %first% %prePage% %linkPage% %nextPage% %end% %downPage%');
$show = $Page->show();
// 分页显示输出
// 进行分页数据查询 注意limit方法的参数要使用Page类的属性
$logdata = $log_model->order('opertime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
//print_r($logdata);
} else {
$log_model = M('log');
import('ORG.Util.Page');
$header = "条操作日志";
$pagesize = 16;
$count = $log_model->where('accountid=' . $_SESSION['accountid'])->count();
// 查询满足要求的总记录数
//print_r($count);
$Page = new Page($count, $pagesize);
// 实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', $header);
$Page->setConfig('prev', '上一页');
$Page->setConfig('next', '下一页');
$Page->setConfig('theme', '共查询出%totalRow%%header% 第%nowPage%页|共%totalPage% 页 %upPage% %first% %prePage% %linkPage% %nextPage% %end% %downPage%');
$show = $Page->show();
// 分页显示输出
// 进行分页数据查询 注意limit方法的参数要使用Page类的属性
$logdata = $log_model->order('opertime desc')->where('accountid=' . $_SESSION['accountid'])->limit($Page->firstRow . ',' . $Page->listRows)->select();
}
$logdata = $this->formatfield($logdata);
$this->assign('logdata', $logdata);
//赋值数据集
$this->assign('page', $show);
//赋值分页输出
$this->display();
}
示例15: index
public function index()
{
import('ORG.Util.Page');
$m = M("Good");
$count = $m->count();
// 查询满足要求的总记录数
$Page = new Page($count, 12);
// 实例化分页类 传入总记录数和每页显示的记录数
$Page->setConfig('header', '条记录');
$Page->setConfig('theme', '<li><a>%totalRow% %header%</a></li> <li>%upPage%</li> <li>%downPage%</li> <li>%first%</li> <li>%prePage%</li> <li>%linkPage%</li> <li>%nextPage%</li> <li>%end%</li> ');
//(对thinkphp自带分页的格式进行自定义)
$show = $Page->show();
// 分页显示输出
$result = $m->limit($Page->firstRow . ',' . $Page->listRows)->select();
for ($i = 0; $i < count($result); $i++) {
$menu_id = $result[$i]["menu_id"];
$result[$i]["menu"] = R("Api/Api/getmenuvalue", array($menu_id));
}
$menu = R("Api/Api/getarraymenu");
$this->assign("menu", $menu);
$this->assign("addmenu", $menu);
$this->assign("page", $show);
// 赋值分页输出
$this->assign("result", $result);
$zhekou = 0;
if (file_exists('./Public/Conf/zhekou.php')) {
require './Public/Conf/zhekou.php';
}
$this->assign("zhekou", $zhekou);
$yongjin = array();
$yongjin['yongjin_1'] = 28;
$yongjin['yongjin_2'] = 13;
$yongjin['yongjin_3'] = 9;
if (file_exists('./Public/Conf/yongjin.php')) {
require './Public/Conf/yongjin.php';
$yongjin = json_decode($yongjin, true);
}
$this->assign("yongjin", $yongjin);
$tixianinfo = array();
$tixianinfo['shouhuo'] = 7;
$tixianinfo['tixian'] = 7;
$tixianinfo['jine'] = 50;
$tixianinfo['dingdan'] = 20000;
if (file_exists('./Public/Conf/tixianinfo.php')) {
require './Public/Conf/tixianinfo.php';
$tixianinfo = json_decode($tixianinfo, true);
}
$this->assign("tixianinfo", $tixianinfo);
$this->display();
}