示例#1
0
 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setDefaults(['preferred_fields' => [], 'groups' => [], 'form_prefix' => function (Options $options, $value) {
         return null === $value ? $options['form_name'] : $value;
     }, 'form_field_prefix' => function (Options $options, $value) {
         return null === $value ? $options['form_prefix'] . '_' : $value;
     }, 'form_group_prefix' => function (Options $options, $value) {
         return null === $value ? $options['form_prefix'] . ':group_' : $value;
     }]);
     $resolver->setAllowedTypes(['preferred_fields' => 'array', 'groups' => 'array', 'form_prefix' => 'string', 'form_field_prefix' => 'string', 'form_group_prefix' => 'string']);
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setOptional(['form_action', 'form_route_name', 'form_route_parameters', 'form_method', 'form_enctype']);
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setRequired(['form_name', 'field_path'])->setAllowedTypes(['form_name' => 'string', 'field_path' => 'string']);
 }