feat: selectable country for custom destinations

This commit is contained in:
Björn Fromme
2024-05-18 15:58:02 +02:00
parent 1908e00dd8
commit ea3f2347e8
3 changed files with 51 additions and 18 deletions
+11
View File
@@ -5,6 +5,7 @@ namespace App\Form;
use App\BusProNet\DataProvider\HotelDataProvider;
use App\Model\DestinationDto;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
@@ -37,6 +38,16 @@ class DestinationType extends AbstractType
'allow_add' => true,
'allow_delete' => true,
])
->add('country', ChoiceType::class, [
'label' => 'Land',
'choices' => [
'Österreich' => 'a',
'Schweiz' => 'ch',
'Frankreich' => 'f',
'Italien' => 'i',
'Deutschland' => 'd',
],
])
->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
$form = $event->getForm();
$data = $event->getData();