Beispiel #1
0
 public function addAction()
 {
     $form = new AdminForm();
     $form->get('submit')->setValue('Add');
     $request = $this->getRequest();
     if ($request->isPost()) {
         $Admin = new Admin();
         $form->setInputFilter($Admin->getInputFilter());
         $form->setData($request->getPost());
         if ($form->isValid()) {
             $Admin->exchangeArray($form->getData());
             $this->getAdminTable()->saveAdmin($Admin);
             // Redirect to list of Admins
             return $this->redirect()->toRoute('Hwi');
         }
     }
     return array('form' => $form);
 }