public function ajaxTotalEventsAction() { if (!$this->autenticacao(true)) { return; } if ($this->getRequest()->isPost()) { $model = new Admin_Model_Evento(); $this->view->num_events = $model->getTotalEvents(); $this->view->ok = true; } else { $this->view->error = $this->t->_('Request could not be completed.'); } }