public function _list() { $tPosts = model_posts::getInstance()->findAll(); $oModulePagination = new module_pagination(); $oModulePagination->setModuleAction('privatePosts::list'); $oModulePagination->setTab($tPosts); $oModulePagination->setLimit(2); $oModulePagination->setPage(_root::getParam('page')); $tPosts = $oModulePagination->getPageElement(); $oView = new _view('privatePosts::list'); $oView->tPosts = $tPosts; $oView->tJoinmodel_categories = model_categories::getInstance()->getSelect(); $oView->tJoinmodel_users = model_users::getInstance()->getSelect(); $oView->oPagination = $oModulePagination; $this->oLayout->add('main', $oView); }
public function _listPagination() { $oArticleModel = new model_article(); $tArticle = $oArticleModel->findAll(); $oModulePagination = new module_pagination(); $oModulePagination->setModuleAction('article::listPagination'); $oModulePagination->setParamPage('page'); $oModulePagination->setLimit(2); $oModulePagination->setPage(_root::getParam('page')); $oModulePagination->setTab($tArticle); $oTpl = new _tpl('article::listPagination'); $oTpl->tArticle = $oModulePagination->getPageElement(); $oTpl->tColumn = $oArticleModel->getListColumn(); $oTpl->oModulePagination = $oModulePagination->build(); $this->oLayout->add('main', $oTpl); }
public function _list() { if ($this->category_id) { $tPosts = model_posts::getInstance()->findByCategory($this->category_id); } else { $tPosts = model_posts::getInstance()->findAll(); } $oModulePagination = new module_pagination(); $oModulePagination->setModuleAction('default::index'); $oModulePagination->setTab($tPosts); $oModulePagination->setLimit(5); $oModulePagination->setPage(_root::getParam('page')); $tPosts = $oModulePagination->getPageElement(); $oView = new _view('posts::list'); $oView->tPosts = $tPosts; $oView->tJoinmodel_categories = model_categories::getInstance()->getSelect(); $oView->tJoinmodel_users = model_users::getInstance()->getSelect(); $oView->oPagination = $oModulePagination; return $oView; }