/** Add a method of discovery */ public function addmethodAction() { $form = new DiscoMethodsForm(); $form->submit->setLabel('Add a new discovery method'); $this->view->form = $form; if ($this->getRequest()->isPost() && $form->isValid($this->_request->getPost())) { if ($form->isValid($form->getValues())) { $methods = new DiscoMethods(); $update = $methods->insert($form->getValues()); $this->_redirect($this->_redirectUrl . 'methods'); $this->_flashMessenger->addMessage('Method of discovery created!'); } else { $this->_flashMessenger->addMessage('Please correct errors'); $form->populate($form->getValues()); } } }