getFormOptions() публичный Метод

public getFormOptions ( ) : array
Результат array
Пример #1
0
 function it_creates_the_object_if_form_is_a_class_name(RequestConfiguration $requestConfiguration, ResourceInterface $resource, FormFactoryInterface $formFactory, FormInterface $form)
 {
     $requestConfiguration->isHtmlRequest()->willReturn(true);
     $requestConfiguration->getFormType()->willReturn(TextType::class);
     $requestConfiguration->getFormOptions()->willReturn([]);
     $formFactory->create(Argument::type(TextType::class), $resource, Argument::type('array'))->willReturn($form);
     $this->create($requestConfiguration, $resource)->shouldReturn($form);
 }
Пример #2
0
 function it_creates_form_without_root_name_and_disables_csrf_protection_for_non_html_requests(RequestConfiguration $requestConfiguration, ResourceInterface $resource, FormFactoryInterface $formFactory, FormInterface $form)
 {
     $requestConfiguration->isHtmlRequest()->willReturn(false);
     $requestConfiguration->getFormType()->willReturn('sylius_product_api');
     $requestConfiguration->getFormOptions()->willReturn([]);
     $formFactory->createNamed('', 'sylius_product_api', $resource, ['csrf_protection' => false])->willReturn($form);
     $this->create($requestConfiguration, $resource)->shouldReturn($form);
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function create(RequestConfiguration $requestConfiguration, ResourceInterface $resource)
 {
     $formType = $requestConfiguration->getFormType();
     $formOptions = $requestConfiguration->getFormOptions();
     if ($requestConfiguration->isHtmlRequest()) {
         return $this->formFactory->create($formType, $resource, $formOptions);
     }
     return $this->formFactory->createNamed('', $formType, $resource, array_merge($formOptions, ['csrf_protection' => false]));
 }