vendor/symfony/form/Extension/Core/Type/HiddenType.php line 17

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\Form\Extension\Core\Type;
  11. use Symfony\Component\Form\AbstractType;
  12. use Symfony\Component\OptionsResolver\OptionsResolver;
  13. class HiddenType extends AbstractType
  14. {
  15.     /**
  16.      * {@inheritdoc}
  17.      */
  18.     public function configureOptions(OptionsResolver $resolver)
  19.     {
  20.         $resolver->setDefaults([
  21.             // hidden fields cannot have a required attribute
  22.             'required' => false,
  23.             // Pass errors to the parent
  24.             'error_bubbling' => true,
  25.             'compound' => false,
  26.             'invalid_message' => 'The hidden field is invalid.',
  27.         ]);
  28.     }
  29.     /**
  30.      * {@inheritdoc}
  31.      */
  32.     public function getBlockPrefix(): string
  33.     {
  34.         return 'hidden';
  35.     }
  36. }