<?php
namespace App\Form;
use App\Entity\Clinics;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
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\FileType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ClinicFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('clinicName', TextType::class, [
'label' => 'Clinic Name*',
'required' => false,
])
->add('telephone', TextType::class, [
'label' => 'Telephone',
'required' => false,
])
->add('email', TextType::class, [
'label' => 'Email',
'required' => false,
])
->add('clinicUsers', CollectionType::class, [
'entry_type' => ClinicUsersFormType::class,
'entry_options' => ['label' => false],
'allow_add' => true,
'allow_delete' => true,
'by_reference' =>false,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Clinics::class,
]);
}
}