本文整理匯總了PHP中Pagination::maxnum方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pagination::maxnum方法的具體用法?PHP Pagination::maxnum怎麽用?PHP Pagination::maxnum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pagination
的用法示例。
在下文中一共展示了Pagination::maxnum方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: indexAction
public function indexAction()
{
//檢查權限
$this->verify(__METHOD__);
$show['pagename'] = '科目列表';
$grade = $this->getRequest()->getQuery('grade', '');
$perpage = 20;
$page = intval($this->getRequest()->getQuery('page'));
$page = $page ? $page : 1;
$data = $count_opt = array();
$option = array('condition' => '', 'order' => 'Grade asc', 'limit' => array('offset' => ($page - 1) * $perpage, 'count' => $perpage));
if (!empty($grade)) {
$option['condition'] .= "grade = ?";
$option['bind'] = array($grade);
$count_opt = array('condition' => "grade = ?", 'bind' => array($grade));
}
$data['subjectList'] = Admin_SubjectModel::instance()->fetchAll($option);
$data['count'] = Admin_SubjectModel::instance()->count($count_opt);
$data['grade'] = RThink_Config::get('app.grade');
$pagination = new Pagination();
$data['pagination'] = $pagination->maxnum($data['count'], $perpage)->show('page_metronic');
$data['menu'] = Widget_Admin_MenuModel::headerMenu();
$this->setInvokeArg('layout', 'admin1_layout');
$this->render($data);
}