Example #1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add($builder->create('type', ChoiceType::class, ['choices' => array_combine(array_map(function ($choice) use($options) {
         return $options['label_prefix'] . '.type.' . $choice;
     }, $choices = TextType::getTypes()), $choices), 'choices_as_values' => true, 'xml_http_request_trigger' => true])->addEventSubscriber($this->textFilterSubscriber));
 }
Example #2
0
 public function testTypes()
 {
     $this->assertSame([TextType::TYPE_CONTAINS, TextType::TYPE_NOT_CONTAINS, TextType::TYPE_EQUALS, TextType::TYPE_NOT_EQUALS, TextType::TYPE_STARTS_WITH, TextType::TYPE_NOT_STARTS_WITH, TextType::TYPE_ENDS_WITH, TextType::TYPE_NOT_ENDS_WITH, TextType::TYPE_EMPTY, TextType::TYPE_NOT_EMPTY], TextType::getTypes());
 }