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


PHP Grid::setTotalRecord方法代码示例

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


在下文中一共展示了Grid::setTotalRecord方法的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::setTotalRecord方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。