src/Form/FossildbSearchFormType.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Contracts\Translation\TranslatorInterface;
  5. use Symfony\Component\Routing\RouterInterface;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\OptionsResolver\OptionsResolver;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Symfony\Component\Form\Extension\Core\Type\TextType;
  10. use Symfony\Component\Form\Extension\Core\Type\IntegerType;
  11. Class FossildbSearchFormType extends AbstractType
  12. {
  13.     private $router;
  14.     public function __construct(RouterInterface $routerTranslatorInterface $translator)
  15.     {
  16.         $this->router $router;
  17.         $this->translator $translator;
  18.     }
  19.     public function buildForm(FormBuilderInterface $builder, array $options)
  20.     {
  21.         $builder
  22.             ->add('taxanomy'TextType::class, [
  23.                 'label' => $this->translator->trans('Fossielgroep'),
  24.                 'required' => false
  25.             ])
  26.             ->add('location'TextType::class, [
  27.                 'label' => $this->translator->trans('Locatie'),
  28.                 'required' => false
  29.             ])
  30.             ->add('era'TextType::class, [
  31.                 'label' => $this->translator->trans('Tijdperk'),
  32.                 'required' => false
  33.             ])
  34.             ->add('id'IntegerType::class, [
  35.                 'label' => $this->translator->trans('PaleonticaID'),
  36.                 'required' => false
  37.             ])
  38.             ->add('user'TextType::class, [
  39.                 'label' => $this->translator->trans('Gebruiker'),
  40.                 'required' => false
  41.             ])
  42.             ->add('genus'TextType::class, [
  43.                 'label' => $this->translator->trans('Genusnaam'),
  44.                 'required' => false
  45.             ])
  46.             ->add('species'TextType::class, [
  47.                 'label' => $this->translator->trans('Soortnaam'),
  48.                 'required' => false
  49.             ])
  50.         ;
  51.     }
  52.     public function configureOptions(OptionsResolver $resolver)
  53.     {
  54.         $resolver->setDefaults([
  55.         ]);
  56.     }
  57. }