From 2e163d526cbb19a90af2a87808b00b932dc1d2e4 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Tue, 31 Dec 2024 23:08:22 +0000 Subject: [PATCH] add location form --- src/Form/LocationFormType.php | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/Form/LocationFormType.php diff --git a/src/Form/LocationFormType.php b/src/Form/LocationFormType.php new file mode 100644 index 0000000..1b5da87 --- /dev/null +++ b/src/Form/LocationFormType.php @@ -0,0 +1,38 @@ +add('name') + ->add('address') + ->add('city') + ->add('state', EnumType::class, [ + 'class' => State::class + ]) + ->add('zip') + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Location::class, + 'csrf_protection' => true, + 'csrf_field_name' => '_token', + 'csrf_token_id' => 'location', + ]); + } +}