Ejemplo n.º 1
0
 /** Add degree of wear details
  */
 public function adddegreeofwearAction()
 {
     $form = new DegreeOfWearForm();
     $form->details->setLegend('Add a new degree of wear term');
     $form->submit->setLabel('Submit term\'s details');
     $this->view->form = $form;
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $degrees = new WearTypes();
             $degrees->add($form->getValues());
             $this->getFlash()->addMessage('New degree of wear term entered');
             $this->redirect($this->_redirectUrl . 'degreesofwear/');
         } else {
             $this->getFlash()->addMessage($this->_formErrors);
             $form->populate($this->_request->getPost());
         }
     }
 }