Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace WIY\UserBundle\Form;
- use Symfony\Component\Form\AbstractType;
- use Symfony\Component\Form\FormBuilderInterface;
- use Symfony\Component\OptionsResolver\OptionsResolverInterface;
- class ProfileFormType extends AbstractType
- {
- /**
- * @param FormBuilderInterface $builder
- * @param array $options
- */
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder
- ->add('niveau','choice', array('attr' => array('class' => 'form-control form-margin'),
- 'choices' => array(
- 'Débutant' => 'Débutant',
- 'Amateur' => 'Amateur',
- 'Expérimenté' => 'Expérimenté',
- 'Professionnel' => 'Professionnel'
- ),
- 'expanded' =>false,
- 'multiple' => false)
- )
- ->add('frequence','choice', array('attr' => array('class' => 'form-control form-margin'),
- 'choices' => array(
- 'ponctuelle (1 à pls fois/an)' => 'ponctuelle (1 à pls fois/an)',
- 'occasionnelle (1 fois/mois)' => 'occasionnelle (1 fois/mois)',
- 'régulière (1ou 2 fois/semaine)' => 'régulière (1ou 2 fois/semaine)',
- 'intensive (3 fois par semaine & +)' => 'intensive (3 fois par semaine & +)'
- ),
- 'expanded' =>false,
- 'multiple' => false)
- )
- ->add('profilePictureFile', 'file',array('required' => false,'label' => 'Photo de profil'))
- ->add('description','textarea',array('required' => false, 'attr' => array('placeholder' => 'Décrivez vous en quelques lignes', 'class' => 'form-control form-margin')))
- ;
- }
- /**
- * @param OptionsResolverInterface $resolver
- */
- public function setDefaultOptions(OptionsResolverInterface $resolver)
- {
- $resolver->setDefaults(array(
- 'data_class' => 'WIY\UserBundle\Entity\User'
- ));
- }
- /**
- * @return string
- */
- public function getName()
- {
- return 'fos_user_profile_show';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement