From f454888a6f45074cca4630e0aa9ca68a6f73ebd1 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Fri, 10 Jan 2025 14:51:44 +0000 Subject: [PATCH] add company form for updating the company --- src/Form/InternalCompanyFormType.php | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/Form/InternalCompanyFormType.php diff --git a/src/Form/InternalCompanyFormType.php b/src/Form/InternalCompanyFormType.php new file mode 100644 index 0000000..f859ecd --- /dev/null +++ b/src/Form/InternalCompanyFormType.php @@ -0,0 +1,51 @@ +add('name', TextType::class, [ + 'required' => true, + 'attr' => [ + 'placeholder' => 'Company Name', + 'class' => 'form-control', + 'autofocus' => true, + 'autocomplete' => 'off' + ] + ]) + ->add('address', TextType::class) + ->add('city', TextType::class) + ->add('state', TextType::class) + ->add('zip', TextType::class) + ->add('phone', TextType::class) + ->add('email', EmailType::class) + ->add('url', UrlType::class, ['required' => false]) + ->add('companyLogo', FileType::class, [ + 'required' => false, + 'mapped' => false + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Company::class, + 'csrf_protection' => true, + 'csrf_field_name' => '_token', + 'csrf_token_id' => 'company', + ]); + } +}