src/Form/SearchFormType.php line 19

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore Customer Management Framework Bundle
  4.  * Full copyright and license information is available in
  5.  * LICENSE.md which is distributed with this source code.
  6.  *
  7.  * @copyright  Copyright (C) Elements.at New Media Solutions GmbH
  8.  * @license    GPLv3
  9.  */
  10. namespace App\Form;
  11. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  12. use Symfony\Component\Form\FormBuilderInterface;
  13. use Symfony\Component\OptionsResolver\OptionsResolver;
  14. use Symfony\Component\Form\Extension\Core\Type\TextType;
  15. class SearchFormType extends DefaultFormType
  16. {
  17.     /**
  18.      * @inheritDoc
  19.      */
  20.     public function buildForm(FormBuilderInterface $builder, array $options)
  21.     {
  22.         $builder
  23.             ->add('term'TextType::class, [
  24.                 'label' => $this->translator->trans('stoelting.search'),
  25.                 'attr'        => [
  26.                     'placeholder' => $this->translator->trans('stoelting.search.placeholder'),
  27.                 ]
  28.             ])
  29.             ->add('_submit'SubmitType::class, [
  30.                 'label' => $this->translator->trans('stoelting.search.button'),
  31.                 'attr' => [
  32.                     'class' => 'btn btn-primary'
  33.                 ]
  34.             ]);
  35.     }
  36.     /**
  37.      * @inheritDoc
  38.      */
  39.     public function getBlockPrefix()
  40.     {
  41.         return '';
  42.     }
  43.     /**
  44.      * @inheritDoc
  45.      */
  46.     public function configureOptions(OptionsResolver $resolver)
  47.     {
  48.     }
  49. }