src/Form/NuevoIngreso/BuscaPreregistroType.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Form\NuevoIngreso;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  5. use Symfony\Component\Form\Extension\Core\Type\TextType;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\OptionsResolver\OptionsResolver;
  8. use Symfony\Component\Validator\Constraints\Length;
  9. use Symfony\Component\Validator\Constraints\NotBlank;
  10. class BuscaPreregistroType extends AbstractType
  11. {
  12.     public function buildForm(FormBuilderInterface $builder, array $options): void
  13.     {
  14.         $builder
  15.             ->add('curp'TextType::class, [
  16.                 'constraints' => [
  17.                     new NotBlank(),
  18.                     new Length(['min' => 18'max' => 18]),
  19.                 ]
  20.             ])
  21.             ->add('clur'TextType::class, [
  22.                 'constraints' => [
  23.                     new NotBlank(),
  24.                     // new Length(['min' => 10, 'max' => 10]),
  25.                 ],
  26.             ])
  27.             ->add('Buscar'SubmitType::class)
  28.         ;
  29.     }
  30.     public function configureOptions(OptionsResolver $resolver): void
  31.     {
  32.         $resolver->setDefaults([
  33.             'data_class' => null
  34.         ]);
  35.     }
  36. }