src/Form/EventListener/Global/Address/AddLatitudeFieldSubscriber.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Form\EventListener\Global\Address;
  4. use App\Form\FormHelper;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. use Symfony\Component\Form\Extension\Core\Type\TextType;
  7. use Symfony\Component\Form\FormEvent;
  8. use Symfony\Component\Form\FormEvents;
  9. class AddLatitudeFieldSubscriber extends FormHelper implements EventSubscriberInterface
  10. {
  11.     public static function getSubscribedEvents(): array
  12.     {
  13.         return [FormEvents::PRE_SET_DATA => 'preSetData'];
  14.     }
  15.     public function preSetData(FormEvent $event): void
  16.     {
  17.         $event->getForm()->add('latitude'TextType::class, $this->getTextParameters(
  18.             'app.admin.pages.cities.form.latitude',
  19.             '53,2734',
  20.             false,
  21.             ['attr' => ['class' => 'address_latitude']]
  22.         ));
  23.     }
  24. }