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


PHP Grid::setPageSize方法代碼示例

本文整理匯總了PHP中Grid::setPageSize方法的典型用法代碼示例。如果您正苦於以下問題:PHP Grid::setPageSize方法的具體用法?PHP Grid::setPageSize怎麽用?PHP Grid::setPageSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Grid的用法示例。


在下文中一共展示了Grid::setPageSize方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: searchresultAction

 public function searchresultAction()
 {
     $page = $this->request->queryString("page");
     if (empty($page)) {
         $page = "1";
     }
     $key = $this->request->getParam('txtKey');
     if (!isset($key)) {
         $key = '';
     } else {
         $key = trim($key);
     }
     $totalRecord = $this->model->get('product')->getTotalResult($key);
     $this->view->data['page'] = $page;
     $this->view->data['totalRecord'] = $totalRecord;
     $this->view->data['pageSize'] = 10;
     $this->view->data['products'] = $this->model->get('product')->getSearchResults($key, $page, $this->view->data['pageSize']);
     $grid = new Grid($this->view->data['products']);
     $grid->setModule('admin');
     $grid->setController('product');
     $grid->setTotalRecord($totalRecord);
     $grid->setPageSize($this->view->data['pageSize']);
     $grid->setPage($page);
     $grid->addColumn(array('header' => 'Tiêu đề bài viết', 'align' => 'left', 'width' => '', 'index' => 'title'));
     $grid->addColumn(array('header' => 'URL key', 'align' => 'left', 'width' => '', 'index' => 'url_key'));
     $grid->addColumn(array('header' => 'Xuất bản', 'align' => 'center', 'width' => '140', 'index' => 'public_time'));
     $grid->addColumn(array('header' => 'Thứ tự', 'align' => 'center', 'width' => '60', 'index' => 'priority'));
     $this->view->data['grid'] = $grid;
     $this->view->show('search');
 }
開發者ID:phithienthan,項目名稱:vnitc,代碼行數:30,代碼來源:productController.php

示例2: indexAction

 public function indexAction()
 {
     $page = $this->request->queryString("page");
     if (empty($page)) {
         $page = "1";
     }
     $userModel = $this->model->get('user');
     $totalRecord = $userModel->getTotalRecord(1);
     $this->view->data['page'] = $page;
     $this->view->data['totalRecord'] = $totalRecord;
     $this->view->data['pageSize'] = 10;
     $this->view->data['users'] = $userModel->getUser($page, $this->view->data['pageSize'], null);
     $grid = new Grid($this->view->data['users']);
     $grid->setModule('admin');
     $grid->setController('user');
     $grid->setTotalRecord($totalRecord);
     $grid->setPageSize($this->view->data['pageSize']);
     $grid->setPage($page);
     $grid->addColumn(array('header' => 'ID', 'align' => 'center', 'width' => '', 'index' => 'id'));
     $grid->addColumn(array('header' => 'Tên truy cập', 'align' => 'left', 'width' => '', 'index' => 'username'));
     $grid->addColumn(array('header' => 'Tên hiển thị', 'align' => 'center', 'width' => '', 'index' => 'display_name'));
     $grid->addColumn(array('header' => 'Email', 'align' => 'center', 'width' => '', 'index' => 'email'));
     $this->view->data['grid'] = $grid;
     $this->view->show('index');
 }
開發者ID:phithienthan,項目名稱:vnitc,代碼行數:25,代碼來源:contactController.php

示例3: indexAction

 public function indexAction()
 {
     $page = $this->request->queryString("page");
     if (empty($page)) {
         $page = "1";
     }
     $model = $this->model->get('feedback');
     $totalRecord = $model->getTotalRecord(1);
     $this->view->data['page'] = $page;
     $this->view->data['totalRecord'] = $totalRecord;
     $this->view->data['pageSize'] = 10;
     $this->view->data['users'] = $model->getAll($page, $this->view->data['pageSize'], null);
     $grid = new Grid($this->view->data['users']);
     $grid->setModule('admin');
     $grid->setController('feedback');
     $grid->setTotalRecord($totalRecord);
     $grid->setPageSize($this->view->data['pageSize']);
     $grid->setPage($page);
     $grid->addColumn(array('header' => 'ID', 'align' => 'center', 'width' => '', 'index' => 'id'));
     $grid->addColumn(array('header' => 'Họ tên', 'align' => 'left', 'width' => '', 'index' => 'fullname'));
     $grid->addColumn(array('header' => 'Thư điện tử', 'align' => 'center', 'width' => '', 'index' => 'email'));
     $grid->addColumn(array('header' => 'Điện thoại', 'align' => 'center', 'width' => '', 'index' => 'phone'));
     $this->view->data['grid'] = $grid;
     $this->view->show('index');
 }
開發者ID:phithienthan,項目名稱:vnitc,代碼行數:25,代碼來源:feedbackController.php

示例4: indexAction

 public function indexAction()
 {
     $page = $this->request->queryString("page");
     if (empty($page)) {
         $page = "1";
     }
     $pageSize = 20;
     $totalRecord = $this->model->get('category')->getTotalRecord();
     $this->view->data['page'] = $page;
     $this->view->data['totalRecord'] = $totalRecord;
     $this->view->data['pageSize'] = $pageSize;
     $this->view->data['parentCategorys'] = $this->model->get('category')->getCategorys($page, $pageSize);
     $categoryGrid = new Grid($this->view->data['parentCategorys']);
     $categoryGrid->setModule('admin');
     $categoryGrid->setController('category');
     $categoryGrid->setTotalRecord($totalRecord);
     $categoryGrid->setPageSize($pageSize);
     $categoryGrid->addColumn(array('header' => 'Tên chuyên mục', 'align' => 'left', 'width' => '', 'index' => 'title'));
     $categoryGrid->addColumn(array('header' => 'URL key', 'align' => 'left', 'width' => '', 'index' => 'url_key'));
     $categoryGrid->addColumn(array('header' => 'Mục cha', 'align' => 'center', 'width' => '60', 'index' => 'parent_id'));
     $categoryGrid->addColumn(array('header' => 'Thứ tự', 'align' => 'center', 'width' => '60', 'index' => 'sort_order'));
     $this->view->data['grid'] = $categoryGrid;
     $this->view->show('index');
 }
開發者ID:phithienthan,項目名稱:vnitc,代碼行數:24,代碼來源:categoryController.php

示例5: indexAction

 public function indexAction()
 {
     $page = $this->request->queryString("page");
     if (empty($page)) {
         $page = "1";
     }
     $bannerModel = $this->model->get('banner');
     $totalRecord = $bannerModel->getTotalRecord(1);
     $this->view->data['page'] = $page;
     $this->view->data['totalRecord'] = $totalRecord;
     $this->view->data['pageSize'] = 10;
     $this->view->data['banners'] = $bannerModel->getBanner($page, $this->view->data['pageSize'], null);
     $grid = new Grid($this->view->data['banners']);
     $grid->setModule('admin');
     $grid->setController('banner');
     $grid->setTotalRecord($totalRecord);
     $grid->setPageSize($this->view->data['pageSize']);
     $grid->setPage($page);
     $grid->addColumn(array('header' => 'ID', 'align' => 'center', 'width' => '', 'index' => 'id'));
     $grid->addColumn(array('header' => 'Tên banner', 'align' => 'left', 'width' => '', 'index' => 'title'));
     $grid->addColumn(array('header' => 'Link', 'align' => 'center', 'width' => '', 'index' => 'link'));
     $this->view->data['grid'] = $grid;
     $this->view->show('index');
 }
開發者ID:phithienthan,項目名稱:vnitc,代碼行數:24,代碼來源:bannerController.php


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