protected function addPagination() { $args = array("totalPages" => $this->query->getTotalPages(), "currentPage" => $this->query->getCurrentPage()); if (isset($this->data["results"]->id)) { $args["id"] = $this->data["results"]->id; } $pager = new \wpmvc\Helpers\Pager($args); $this->data["pagination"] = $pager->paginate(); }
public function result() { $this->iTotalNotes = $this->oNoteModel->search($this->httpRequest->get('looking'), true, $this->httpRequest->get('order'), $this->httpRequest->get('sort'), null, null, $this->iApproved); $this->view->total_pages = $this->oPage->getTotalPages($this->iTotalNotes, 10); $this->view->current_page = $this->oPage->getCurrentPage(); $oSearch = $this->oNoteModel->search($this->httpRequest->get('looking'), false, $this->httpRequest->get('order'), $this->httpRequest->get('sort'), $this->oPage->getFirstItem(), $this->oPage->getNbItemsByPage(), $this->iApproved); $this->setMenuVars(); if (empty($oSearch)) { $this->sTitle = t('Sorry, Your search returned no results!'); $this->notFound(); } else { $this->sTitle = t('Dating Social Note - Your search returned'); $this->view->page_title = $this->sTitle; $this->view->h2_title = $this->sTitle; $this->view->h3_title = nt('%n% Note Result!', '%n% Notes Result!', $this->iTotalNotes); $this->view->meta_description = t('Search - Dating Social Community Note'); $this->view->meta_keywords = t('search,note,dating,social network,community,news'); $this->view->posts = $oSearch; } $this->manualTplInclude('index.tpl'); $this->output(); }
/** * Get current page * @return integer */ public function getCurrentPage() { return $this->paginator->getCurrentPage(); }