Inheritance: extends Symfony\Component\Form\AbstractType
Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     if ($options['allow_add'] && $options['prototype']) {
         $prototype = $builder->create('${id}', $options['type'], $options['options']);
         $builder->setAttribute('prototype', $prototype->getForm());
     }
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(array('controller' => null));
 }
 public function finishView(FormView $view, FormInterface $form, array $options)
 {
     parent::finishView($view, $form, $options);
     $view->vars['edit_mode_enabled'] = $options['edit_mode_enabled'];
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setRequired(['data']);
     $resolver->setDefaults(['data_class' => null, 'type' => QuoteProductToOrderType::NAME]);
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
 }
 /**
  * @param OptionsResolverInterface|OptionsResolver $resolver
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefault('type', 'context');
 }
Ejemplo n.º 7
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('type' => new ColumnEnumType(), 'column_count' => 1, 'options' => ['label' => false]));
 }
 /**
  * @param OptionsResolverInterface|OptionsResolver $resolver
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefault('type', 'vulnerability');
 }
 /**
  * Get and set an upload token for this upload form.
  *
  * @param FormView      $view
  * @param FormInterface $form
  * @param array         $options
  */
 public function finishView(FormView $view, FormInterface $form, array $options)
 {
     parent::finishView($view, $form, $options);
     /*
      * Dump the last index (key) of attachment collection array into the view so we can
      * add new items without accidentally overriding already existing ones
      */
     $data = $form->getData();
     end($data);
     $key = key($data);
     $view->vars['attachment_index'] = $key;
     // dump the form's csrf token into the view
     $token = $this->tokenManager->getToken($view->vars['full_name']);
     $view->vars['_file_upload_token'] = $token->getValue();
 }