src/Form/Type/CheckDniType.php line 16

  1. <?php
  2. namespace App\Form\Type;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\FormBuilderInterface;
  5. use Symfony\Component\OptionsResolver\OptionsResolver;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Symfony\Component\Validator\Constraints\Positive;
  8. use Symfony\Component\Validator\Constraints\Callback;
  9. use Symfony\Component\Validator\Constraints\NotBlank;
  10. use Symfony\Component\Validator\Context\ExecutionContextInterface;
  11. use Symfony\Component\Form\Extension\Core\Type\TextType;
  12. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  13. use Symfony\Component\Form\Extension\Core\Type\NumberType;
  14. class CheckDniType extends AbstractType
  15. {
  16.    public function buildForm(FormBuilderInterface $builder, array $options)
  17.    {
  18.         $builder ->add('DNI'TextType::class,array(
  19.                     'label' => false,
  20.                     'attr' => array(
  21.                         'placeholder' => $options['sm']->getValue('cart2.idnumber')
  22.                     )
  23.                 ));
  24.    }
  25.    
  26.     public function configureOptions(OptionsResolver $resolver)
  27.     {
  28.         $resolver->setDefaults(
  29.             [
  30.                 "opciones" => [],
  31.                 "sm" => null,
  32.                 "valores" => []
  33.             ]);
  34.             
  35.             
  36.     }
  37.     
  38.     public function getName()
  39.     {
  40.         return 'check_dni';
  41.     }    
  42.     
  43.