Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2.  
  3. namespace MY\Bundle\Form\Post;
  4.  
  5. use Symfony\Component\Form\AbstractType;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  8.  
  9. class GalleryImageType extends AbstractType
  10. {
  11.         /**
  12.      * @param FormBuilderInterface $builder
  13.      * @param array $options
  14.      */
  15.     public function buildForm(FormBuilderInterface $builder, array $options)
  16.     {
  17.         $builder
  18.             ->add('image', 'file')
  19.         ;
  20.     }
  21.    
  22.     /**
  23.      * @param OptionsResolverInterface $resolver
  24.      */
  25.     public function setDefaultOptions(OptionsResolverInterface $resolver)
  26.     {
  27.         $resolver->setDefaults(array(
  28.             'data_class' => 'My\Bundle\Entity\Post\GalleryImage'
  29.         ));
  30.     }
  31.  
  32.     /**
  33.      * @return string
  34.      */
  35.     public function getName()
  36.     {
  37.         return 'gallery_image';
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement