Ejemplo n.º 1
0
 public function index03Action()
 {
     $form = new \Form\Form\Register();
     if ($this->request->isPost()) {
         $data = $this->params()->fromPost();
         // $data = $this->request->getPost();
         $form->setData($data);
         if ($form->isValid()) {
             echo "<pre style='font-weight:bold'>";
             print_r($form->getData());
             echo "</pre>";
         }
     }
     return new ViewModel(array("myFormRegister" => $form));
 }
Ejemplo n.º 2
0
 public function exerciseTwoAction()
 {
     $myForm = new \Form\Form\Register();
     $object = new ArrayObject(array("card-holder-name" => "Trọng Boss", "card-number" => "024729523", "expiry-month" => "11", "expiry-year" => "15"));
     $myForm->bind($object);
     return new ViewModel(array("myFormRegister" => $myForm));
 }