/**
  * @param \AV\Form\FormBlueprint $form
  * @param null $request
  * @param mixed $entities
  * @param null $formView
  * @return \AV\Form\FormHandler
  */
 public function build(FormBlueprint $form, $request = null, $entities = array(), $formView = null)
 {
     if (!$formView) {
         $formView = new FormView();
         if (isset($this->translator)) {
             $formView->setTranslator($this->translator);
         }
     }
     $validatorExtension = new LaravelValidatorExtension();
     $formHandler = $this->formHandlerFactory->buildForm($form, $formView, $validatorExtension);
     if (!is_array($entities)) {
         $entities = array($entities);
     }
     foreach ($entities as $entity) {
         $formHandler->bindEntity($entity);
     }
     if ($request) {
         $formHandler->handleRequest($request);
     }
     return $formHandler;
 }
Beispiel #2
0
 public function testSubmitted()
 {
     $this->formView->setSubmitted(true);
     $this->assertTrue($this->formView->isSubmitted());
 }