src/Form/VisaApplicantType.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Form;
  3. use App\Entity\VisaApplicant;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\OptionsResolver\OptionsResolver;
  8. use Symfony\Component\Form\Extension\Core\Type\TextType;
  9. use Symfony\Component\Form\Extension\Core\Type\DateType;
  10. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  11. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  12. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  13. class VisaApplicantType extends AbstractType
  14. {
  15.     public function buildForm(FormBuilderInterface $builder, array $options): void
  16.     {
  17.         $builder
  18.             ->add('surname'TextType::class, [
  19.                 'label' => 'Surname'
  20.             ])
  21.             ->add('firstName'TextType::class, [
  22.                 'label' => 'First Name'
  23.             ])
  24.             ->add('previousName'TextType::class, [
  25.                 'label' => 'Previous/Other Name if any',
  26.                 'required' => false
  27.             ])
  28.             ->add('sex'ChoiceType::class, [
  29.                 'label' => 'Sex',
  30.                 'choices' => [
  31.                     'Male' => 'male',
  32.                     'Female' => 'female',
  33.                     'Other' => 'other'
  34.                 ],
  35.                 'expanded' => true,
  36.                 'multiple' => false
  37.             ])
  38.             ->add('maritalStatus'TextType::class, [
  39.                 'label' => 'Marital Status'
  40.             ])
  41.             ->add('dateOfBirth'DateType::class, [
  42.                 'label' => 'Date of Birth',
  43.                 'widget' => 'single_text',
  44.                 'format' => 'yyyy-MM-dd'
  45.             ])
  46.             ->add('religion'TextType::class, [
  47.                 'label' => 'Religion'
  48.             ])
  49.             ->add('placeOfBirth'TextType::class, [
  50.                 'label' => 'Place of Birth'
  51.             ])
  52.             ->add('townCity'TextType::class, [
  53.                 'label' => 'Town/City'
  54.             ])
  55.             ->add('countryOfBirth'TextType::class, [
  56.                 'label' => 'Country of Birth'
  57.             ])
  58.             ->add('citizenshipNationalIdNo'TextType::class, [
  59.                 'label' => 'Citizenship/National ID No'
  60.             ])
  61.             ->add('educationalQualification'TextType::class, [
  62.                 'label' => 'Educational Qualification'
  63.             ])
  64.             ->add('currentNationality'TextType::class, [
  65.                 'label' => 'Current Nationality'
  66.             ])
  67.             ->add('nationalityByBirthOrNaturalization'TextType::class, [
  68.                 'label' => 'Nationality by Birth/Naturalization'
  69.             ])
  70.             ->add('previousNationality'TextType::class, [
  71.                 'label' => 'Any Other Previous/Past Nationality',
  72.                 'required' => false
  73.             ])
  74.             ->add('passportNumber'TextType::class, [
  75.                 'label' => 'Passport No.'
  76.             ])
  77.             ->add('passportDateOfIssue'DateType::class, [
  78.                 'label' => 'Date of Issue',
  79.                 'widget' => 'single_text',
  80.                 'format' => 'yyyy-MM-dd'
  81.             ])
  82.             ->add('passportPlaceOfIssue'TextType::class, [
  83.                 'label' => 'Place of Issue'
  84.             ])
  85.             ->add('passportDateOfExpiry'DateType::class, [
  86.                 'label' => 'Date of Expiry',
  87.                 'widget' => 'single_text',
  88.                 'format' => 'yyyy-MM-dd'
  89.             ])
  90.             ->add('hasOtherPassportOrIC'ChoiceType::class, [
  91.                 'label' => 'Any other Passport/Identity Certificate held',
  92.                 'choices' => [
  93.                     'Yes' => true,
  94.                     'No' => false
  95.                 ],
  96.                 'expanded' => true,
  97.                 'multiple' => false
  98.             ])
  99.             ->add('otherPassportCountryOfIssue'TextType::class, [
  100.                 'label' => 'Country of Issue',
  101.                 'required' => false
  102.             ])
  103.             ->add('otherPassportPlaceOfIssue'TextType::class, [
  104.                 'label' => 'Place of Issue',
  105.                 'required' => false
  106.             ])
  107.             ->add('otherPassportNumber'TextType::class, [
  108.                 'label' => 'Passport/IC No',
  109.                 'required' => false
  110.             ])
  111.             ->add('otherPassportDateOfIssue'DateType::class, [
  112.                 'label' => 'Date of Issue',
  113.                 'widget' => 'single_text',
  114.                 'format' => 'yyyy-MM-dd',
  115.                 'required' => false
  116.             ])
  117.             ->add('otherPassportNationality'TextType::class, [
  118.                 'label' => 'Nationality/Status',
  119.                 'required' => false
  120.             ])
  121.             ->add('phoneNumber'TextType::class, [
  122.                 'label' => 'Phone No'
  123.             ])
  124.             ->add('mobileNumber'TextType::class, [
  125.                 'label' => 'Mobile/Cell No'
  126.             ])
  127.             ->add('presentAddress'TextareaType::class, [
  128.                 'label' => 'Present Address'
  129.             ])
  130.             ->add('emailAddress'EmailType::class, [
  131.                 'label' => 'Email Address'
  132.             ])
  133.             ->add('permanentAddress'TextareaType::class, [
  134.                 'label' => 'Permanent Address'
  135.             ])
  136.             ->add('presentOccupation'TextType::class, [
  137.                 'label' => 'Present Occupation'
  138.             ])
  139.             ->add('designation'TextType::class, [
  140.                 'label' => 'Designation/Rank'
  141.             ])
  142.             ->add('employerName'TextType::class, [
  143.                 'label' => 'Employer Name/Business'
  144.             ])
  145.             ->add('employerAddress'TextareaType::class, [
  146.                 'label' => 'Employer Address'
  147.             ])
  148.             ->add('employerPhoneNumber'TextType::class, [
  149.                 'label' => 'Employer Phone Number'
  150.             ])
  151.             ->add('pastOccupation'TextType::class, [
  152.                 'label' => 'Past Occupation (if any)',
  153.                 'required' => false
  154.             ])
  155.             ->add('workedWithForces'ChoiceType::class, [
  156.                 'label' => 'Have you worked with Armed forces/Police/Para Military forces?',
  157.                 'choices' => [
  158.                     'Yes' => true,
  159.                     'No' => false
  160.                 ],
  161.                 'expanded' => true,
  162.                 'multiple' => false
  163.             ])
  164.             ->add('securityOrganization'TextType::class, [
  165.                 'label' => 'Organization',
  166.                 'required' => false
  167.             ])
  168.             ->add('securityDesignation'TextType::class, [
  169.                 'label' => 'Designation',
  170.                 'required' => false
  171.             ])
  172.             ->add('securityPlaceOfPosting'TextType::class, [
  173.                 'label' => 'Place of Posting',
  174.                 'required' => false
  175.             ])
  176.             ->add('securityRank'TextType::class, [
  177.                 'label' => 'Rank',
  178.                 'required' => false
  179.             ])
  180.             ->add('declarationStatus'CheckboxType::class,[
  181.                 'label'=>false,
  182.             ])
  183.         ;
  184.     }
  185.     public function configureOptions(OptionsResolver $resolver): void
  186.     {
  187.         $resolver->setDefaults([
  188.             'data_class' => VisaApplicant::class,
  189.         ]);
  190.     }
  191. }