コード例 #1
0
 public function addAction()
 {
     $form = new TipoEquipamentoForm();
     $form->get('submit')->setAttribute('label', 'Add');
     $request = $this->getRequest();
     if ($request->isPost()) {
         $tipoequipamento = new TipoEquipamento();
         $form->setInputFilter($tipoequipamento->getInputFilter());
         $form->setData($request->getPost());
         if ($form->isValid()) {
             $tipoequipamento->populate($form->getData());
             $this->getEntityManager()->persist($tipoequipamento);
             $this->getEntityManager()->flush();
             // Redirect to list of albums
             return $this->redirect()->toRoute('tipoequipamento');
         }
     }
     return array('form' => $form);
 }
 /**
  * {@inheritDoc}
  */
 public function getInputFilter()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getInputFilter', array());
     return parent::getInputFilter();
 }