src/Products/NotificationsBundle/Form/Forms/Templates/TemplateSearchForm.php line 11

Open in your IDE?
  1. <?php
  2. namespace Products\NotificationsBundle\Form\Forms\Templates;
  3. use App\Form\Forms\SearchForm;
  4. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  5. use Symfony\Component\Form\Extension\Core\Type\SearchType;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\OptionsResolver\OptionsResolver;
  8. final class TemplateSearchForm extends SearchForm
  9. {
  10.     /**
  11.      * {@inheritDoc}
  12.      */
  13.     public function buildForm(FormBuilderInterface $builder, array $options)
  14.     {
  15.         parent::buildForm($builder$options);
  16.         $builder
  17.             ->add('defaults'HiddenType::class, [
  18.                 'required' => false,
  19.             ])
  20.             ->add('lookup'SearchType::class, [
  21.                 'required' => false,
  22.                 'attr' => [
  23.                     'placeholder' => 'Search templates...',
  24.                 ],
  25.             ])
  26.         ;
  27.     }
  28.     /**
  29.      * {@inheritDoc}
  30.      */
  31.     public function configureOptions(OptionsResolver $resolver)
  32.     {
  33.         parent::configureOptions($resolver);
  34.         $resolver->setDefault('search_filters_label_format''app.notifications.templates.filters.%s');
  35.     }
  36. }