From 774acebf79f1959c80a3bc30614d56edbf72c20a Mon Sep 17 00:00:00 2001 From: thisfro Date: Wed, 19 May 2021 13:25:48 +0200 Subject: [PATCH] Add Label for ZIP and make desc not required --- migrations/Version20210519090349.php | 31 ++++++++++++++++++++++++++++ src/Form/OfferingFormType.php | 9 ++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 migrations/Version20210519090349.php diff --git a/migrations/Version20210519090349.php b/migrations/Version20210519090349.php new file mode 100644 index 0000000..ef91083 --- /dev/null +++ b/migrations/Version20210519090349.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE offering ALTER COLUMN description DROP NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + } +} diff --git a/src/Form/OfferingFormType.php b/src/Form/OfferingFormType.php index 79728fd..1cfae36 100644 --- a/src/Form/OfferingFormType.php +++ b/src/Form/OfferingFormType.php @@ -5,6 +5,7 @@ namespace App\Form; use App\Entity\Offering; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\FileType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -16,8 +17,12 @@ class OfferingFormType extends AbstractType { $builder ->add('title') - ->add('zipCode') - ->add('description') + ->add('zipCode', TextType::class, [ + 'label' => 'ZIP', + ]) + ->add('description', null, [ + 'required' => false, + ]) ->add('photo', FileType::class, [ 'required' => false, 'mapped' => false,