src/Form/ClinicFormType.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\Clinics;
  4. use FOS\CKEditorBundle\Form\Type\CKEditorType;
  5. use Symfony\Component\Form\AbstractType;
  6. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  7. use Symfony\Component\Form\Extension\Core\Type\CollectionType;
  8. use Symfony\Component\Form\Extension\Core\Type\FileType;
  9. use Symfony\Component\Form\Extension\Core\Type\PasswordType;
  10. use Symfony\Component\Form\Extension\Core\Type\TextType;
  11. use Symfony\Component\Form\FormBuilderInterface;
  12. use Symfony\Component\OptionsResolver\OptionsResolver;
  13. class ClinicFormType extends AbstractType
  14. {
  15.     public function buildForm(FormBuilderInterface $builder, array $options): void
  16.     {
  17.         $builder
  18.             ->add('clinicName'TextType::class, [
  19.                 'label' => 'Clinic Name*',
  20.                 'required' => false,
  21.             ])
  22.             ->add('telephone'TextType::class, [
  23.                 'label' => 'Telephone',
  24.                 'required' => false,
  25.             ])
  26.             ->add('email'TextType::class, [
  27.                 'label' => 'Email',
  28.                 'required' => false,
  29.             ])
  30.             ->add('clinicUsers'CollectionType::class, [
  31.                 'entry_type' => ClinicUsersFormType::class,
  32.                 'entry_options' => ['label' => false],
  33.                 'allow_add' => true,
  34.                 'allow_delete' => true,
  35.                 'by_reference' =>false,
  36.             ])
  37.         ;
  38.     }
  39.     public function configureOptions(OptionsResolver $resolver): void
  40.     {
  41.         $resolver->setDefaults([
  42.             'data_class' => Clinics::class,
  43.         ]);
  44.     }
  45. }