Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Application\UserBundle\Form;
- use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
- use Doctrine\ODM\MongoDB\DocumentManager;
- use FOS\UserBundle\Model\UserInterface;
- use Symfony\Component\Form\AbstractType;
- use Symfony\Component\Form\FormBuilder;
- class UserFormType
- {
- public function buildForm(FormBuilder $builder, array $options)
- {
- $builder->add('firstname', 'text', array(
- 'label' => 'user.registration.firstname',
- 'required' => true
- ));
- $builder->add('email', 'text', array(
- 'label' => 'user.registration.email',
- 'required' => true
- ));
- $builder->add('plainPassword', 'repeated', array(
- 'label' => 'user.registration.password',
- 'type' => 'password',
- 'required' => true
- ));
- $builder->add('gender', 'choice', array(
- 'label' => 'user.registration.gender',
- 'choices' => array('m' => 'Male', 'f' => 'Female'),
- 'expanded' => true,
- 'required' => true
- ));
- $builder->add('birthday', 'birthday', array(
- 'label' => 'user.registration.birthday',
- // 'widget' => 'choice',
- 'input' => 'string',
- 'format' => \IntlDateFormatter::SHORT,
- 'widget' => 'single_text',
- 'required' => true
- ));
- $builder->add('nationality', 'country', array(
- 'label' => 'user.registration.nationality'
- ));
- }
- public function getDefaultOptions(array $options)
- {
- $options['validation_groups'] = array('RegistrationBattl');
- return $options;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement