本文整理汇总了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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}