/** * Create new post */ public function createAction() { $form = new Blog_Form_Post_Create(); if ($this->getRequest()->isPost() && $form->isValid($this->_getAllParams())) { $posts = new Blog_Model_Post_Table(); $post = $posts->createRow(); $post->setFromArray($form->getValues()); $post->save(); $this->_helper->flashMessenger->addMessage('Post created'); $this->_helper->redirector('index', null, null, array('alias' => $post->alias)); } $this->view->form = $form; }
protected function _submit() { return parent::_submit()->setLabel('Save'); }