/** * Searches for pagina */ public function searchAction() { $numberPage = 1; if ($this->request->isPost()) { $query = Criteria::fromInput($this->di, "Pagina", $_POST); $this->persistent->parameters = $query->getParams(); } else { $numberPage = $this->request->getQuery("page", "int"); } $parameters = $this->persistent->parameters; if (!is_array($parameters)) { $parameters = array(); } $parameters["order"] = "pagina_id"; $pagina = Pagina::find($parameters); if (count($pagina) == 0) { $this->flash->notice("The search did not find any pagina"); return $this->dispatcher->forward(array("controller" => "pagina", "action" => "index")); } $paginator = new Paginator(array("data" => $pagina, "limit" => 10, "page" => $numberPage)); $this->view->page = $paginator->getPaginate(); }