Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. <?php
  2.  
  3. namespace WIY\UserBundle\Form;
  4.  
  5. use Symfony\Component\Form\AbstractType;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  8.  
  9. class ProfileFormType 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('niveau','choice', array('attr' => array('class' => 'form-control form-margin'),
  19. 'choices' => array(
  20. 'Débutant' => 'Débutant',
  21. 'Amateur' => 'Amateur',
  22. 'Expérimenté' => 'Expérimenté',
  23. 'Professionnel' => 'Professionnel'
  24. ),
  25. 'expanded' =>false,
  26. 'multiple' => false)
  27. )
  28. ->add('frequence','choice', array('attr' => array('class' => 'form-control form-margin'),
  29. 'choices' => array(
  30. 'ponctuelle (1 à pls fois/an)' => 'ponctuelle (1 à pls fois/an)',
  31. 'occasionnelle (1 fois/mois)' => 'occasionnelle (1 fois/mois)',
  32. 'régulière (1ou 2 fois/semaine)' => 'régulière (1ou 2 fois/semaine)',
  33. 'intensive (3 fois par semaine & +)' => 'intensive (3 fois par semaine & +)'
  34. ),
  35. 'expanded' =>false,
  36. 'multiple' => false)
  37. )
  38. ->add('profilePictureFile', 'file',array('required' => false,'label' => 'Photo de profil'))
  39. ->add('description','textarea',array('required' => false, 'attr' => array('placeholder' => 'Décrivez vous en quelques lignes', 'class' => 'form-control form-margin')))
  40. ;
  41. }
  42.  
  43. /**
  44. * @param OptionsResolverInterface $resolver
  45. */
  46. public function setDefaultOptions(OptionsResolverInterface $resolver)
  47. {
  48. $resolver->setDefaults(array(
  49. 'data_class' => 'WIY\UserBundle\Entity\User'
  50. ));
  51. }
  52. /**
  53. * @return string
  54. */
  55. public function getName()
  56. {
  57. return 'fos_user_profile_show';
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement