src/Cms/FileBundle/Form/Type/SpecialFileModalType.php line 16

Open in your IDE?
  1. <?php
  2. namespace Cms\FileBundle\Form\Type;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\FormInterface;
  5. use Symfony\Component\Form\FormView;
  6. use Symfony\Component\Form\Extension\Core\Type\TextType;
  7. use Symfony\Component\OptionsResolver\OptionsResolver;
  8. /**
  9.  * Class SpecialFileModalType
  10.  *
  11.  * @package Cms\FileBundle\Form\Type
  12.  */
  13. final class SpecialFileModalType extends AbstractType
  14. {
  15.     /**
  16.      * {@inheritdoc}
  17.      */
  18.     public function buildView(FormView $viewFormInterface $form, array $options)
  19.     {
  20.         $view->vars['container'] = $options['container'];
  21.     }
  22.     /**
  23.      * {@inheritdoc}
  24.      */
  25.     public function configureOptions(OptionsResolver $resolver)
  26.     {
  27.         $resolver->setRequired(array(
  28.             'container',
  29.         ));
  30.     }
  31.     /**
  32.      * {@inheritdoc}
  33.      * This should be treated as a hidden form type, as its display is rather complex and is handled specially.
  34.      */
  35.     public function getParent(): ?string
  36.     {
  37.         return TextType::class;
  38.     }
  39. }