Пример #1
0
 public function addAction()
 {
     $form = new Admin_Form_ResultForm();
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         $formData = $this->getRequest()->getPost();
         if ($form->isValid($formData)) {
             unset($formData['submit']);
             unset($formData["result_id"]);
             try {
                 $resultModel = new Admin_Model_Result();
                 $resultModel->add($formData);
                 $this->_helper->FlashMessenger->addMessage(array("success" => "Successfully Result added"));
                 $this->_helper->redirector('index');
             } catch (Exception $e) {
                 $this->_helper->FlashMessenger->addMessage(array("error" => $e->getMessage()));
             }
         }
     }
 }