public function createAction() { $roleCreateForm = new Application_Form_RoleCreate(); /** @var $request Zend_Controller_Request_Http */ $request = $this->getRequest(); if ($request->isPost() && $roleCreateForm->isValid($request->getPost())) { $model = new Application_Model_Role(); $model->setFromArray($roleCreateForm->getValues()); $this->_getRoleMapper()->save($model); $this->getFlashMessenger()->addSuccessMessage(sprintf('successfully created role with id %d', $model->getId())); $this->_redirect($this->url('index'), array('exit' => true)); } $this->view->assign('form', $roleCreateForm); }
public function init() { parent::init(); $this->getElement('submit')->setLabel('Edit user'); }