public function registroAction() { try { if (!empty($_POST['username']) && !empty($_POST['email']) && !empty($_POST['password'])) { if ($_POST['password'] == $_POST['password']) { $this->adapter = $this->getServiceLocator()->get('AdapterDb'); $ModelUsuario = new ModelUsuario($this->adapter); //alias para contatoTable $user = $ModelUsuario->save($_POST); if ($user) { } } else { $this->data['class'] = 'danger'; $this->data['msg'] = 'Senha de confirmacao nao condiz'; } } else { $this->data['class'] = 'danger'; $this->data['msg'] = 'Favor preencher todos os campos'; } } catch (Exepction $e) { die($e->getMessage()); } //var_dump($this->data); //die('file'); //die('chegou'); $this->data['flag'] = 'registro'; $view = new ViewModel($this->data); $view->setTemplate('application/index/logar.phtml'); //path to phtml file under view return $view; //return new ViewModel(); }