コード例 #1
0
ファイル: InstitutionEdit.php プロジェクト: racporto/c3op
 public function init()
 {
     parent::init();
     // initialize form
     $this->setName('editInstitutionForm')->setAction('/register/institution/edit')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidator('Int')->addFilter('StringTrim');
     $this->addElement($id);
 }
コード例 #2
0
 public function createAction()
 {
     // cria form
     $form = new C3op_Form_InstitutionCreate();
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         $postData = $this->getRequest()->getPost();
         try {
             if ($form->isValid($postData)) {
                 $form->process($postData);
                 $this->_helper->getHelper('FlashMessenger')->addMessage('The record was successfully updated.');
                 $this->_redirect('/register/institution/success-create');
             }
         } catch (Exception $e) {
             $this->view->form = $form;
             return $this->render('create');
         }
     }
 }