Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- sonata_user:
- security_acl: false
- manager_type: orm # can be orm or mongodb
- profile:
- register:
- form:
- type: custom_user_registration
- handler: sonata.user.registration.form.handler.default
- name: sonata_user_registration_form
- validation_groups:
- # Defaults:
- - myRegistration
- - Default
- ...
- ApplicationSonataUserBundleEntityUser:
- constraints:
- - SymfonyBridgeDoctrineValidatorConstraintsUniqueEntity: email
- properties:
- email:
- - NotBlank:
- groups: [myRegistration]
- - Email:
- groups: [myRegistration]
- checkMX: true
- plainPassword:
- - NotBlank:
- groups: [myRegistration]
- - Length:
- groups: [myRegistration]
- min: 6
- max: 1024
- minMessage: "[T]PASWORD_IS_SHORT[/T]"
- class RegistrationFormType extends AbstractType {
- public function buildForm(FormBuilderInterface $builder, array $options) {
- $builder->remove('username')
- ->remove('email')
- ->remove('plainPassword');
- $builder
- ->add('email', 'email', array(
- 'label' => '[T]EMAIL[/T]',
- 'translation_domain' => 'FOSUserBundle'
- ))
- ->add('plainPassword', 'repeated', array(
- 'type' => 'password',
- 'options' => array('translation_domain' => 'FOSUserBundle'),
- 'first_options' => array('label' => '[T]PASSWORD[/T]'),
- 'second_options' => array('label' => '[T]PASSWORD_CONFIRM[/T]'),
- 'invalid_message' => 'fos_user.password.mismatch',
- ))
- ->add('us_reportable_agreement', 'choice', array(
- 'label_attr' => array('class' => 'centered_label'),
- 'label' => '[T]US_REPORTABLE_AGREEMENT[/T]',
- 'required' => true,
- 'expanded'=>true,
- 'multiple'=>false,
- 'choices' => array('accept' => '[T]US_REPORTABLE_AGREEMENT_ACCEPT[/T]', 'decline' => '[T]US_REPORTABLE_AGREEMENT_DECLINE[/T]'),
- ));
- }
Add Comment
Please, Sign In to add comment