Created
November 2, 2011 23:09
-
-
Save eminetto/1335245 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function createAction() | |
{ | |
$form = new Application_Form_Post(); | |
$post = new Application_Model_Posts(); | |
//tem dados | |
if ($this->_request->isPost()) { | |
//form valido | |
if ($form->isValid($this->_request->getPost())) { | |
$id = $post->insert($form->getValues()); | |
$this->_redirect('post/retrieve'); | |
}//form invalido | |
else { // Mostra os erros e popula o form com os dados | |
$form->populate($form->getValues()); | |
} | |
} | |
$this->view->form = $form; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment