Created
May 31, 2017 13:48
-
-
Save rileyrg/64731c8748532c686119f20d77372849 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NameFilterType extends AbstractType | |
{ | |
//todo NOT USED as wont map to the person object | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('firstName', TextFilterType::class, [ | |
'condition_pattern'=>FilterOperands::OPERAND_SELECTOR, | |
'required' => false, | |
'label' => "person.firstName", | |
'error_bubbling' => false, | |
] | |
) | |
->add('surname', TextFilterType::class, [ | |
'condition_pattern'=>FilterOperands::OPERAND_SELECTOR, | |
'required' => false, | |
"label" => "person.surname", | |
]); | |
} | |
public function getBlockPrefix() | |
{ | |
return 'name_filter'; | |
} | |
public function configureOptions(OptionsResolver $resolver) | |
{ | |
$resolver->setDefaults([ | |
'required' => false, | |
'data_class' => "AppBundle\Entity\Person", | |
'translation_domain' => null, | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment