src/Form/Blog/SearchFormType.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Form\Blog;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  5. use Symfony\Component\Form\Extension\Core\Type\TextType;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. class SearchFormType extends AbstractType
  8. {
  9.     public function buildForm(FormBuilderInterface $builder, array $options)
  10.     {
  11.         parent::buildForm($builder$options);
  12.         $builder
  13.             ->add('q'TextType::class, ['label' => 'Buscar''required' => true'attr' => ['placeholder' => 'Buscar''class' => 'form-control']])
  14.             // ->add('submit', SubmitType::class, ['label' => 'Buscar', 'attr' => ['class' => 'btn btn-primary send']])
  15.         ;
  16.     }
  17.     public function setDefaultOptions(OptionsResolverInterface $resolver)
  18.     {
  19.         $resolver->setDefaults([]);
  20.     }
  21.     public function getName()
  22.     {
  23.         return 'comment_form';
  24.     }
  25. }