Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. Форма:
  2. $builder
  3. ->add('email', 'email', array('label' => 'form.email', 'translation_domain' => 'FOSUserBundle'))
  4. ->add('username', null, array('label' => 'form.username', 'translation_domain' => 'FOSUserBundle'))
  5. ->add('plainPassword', 'repeated', array(
  6. 'type' => 'password',
  7. 'options' => array('translation_domain' => 'FOSUserBundle'),
  8. 'first_options' => array('label' => 'form.password'),
  9. 'second_options' => array('label' => 'form.password_confirmation'),
  10. 'invalid_message' => 'fos_user.password.mismatch',
  11. ))
  12.  
  13. Вьюшка:
  14. {{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }}
  15.  
  16. <div class="form-group">
  17. {{ form_label(form.email, null, {'label_attr': {'class': ''}}) }}
  18.  
  19. {{ form_widget(form.email, {'attr': {'class': 'form-control'}}) }}
  20.  
  21. </div>
  22.  
  23. <div class="form-group">
  24.  
  25. {{ form_label(form.username, null, {'label_attr': {'class': ''}}) }}
  26.  
  27. {{ form_widget(form.username, {'attr': {'class': 'form-control'}}) }}
  28.  
  29. </div>
  30.  
  31. <div class="form-group">
  32.  
  33. {{ form_label(form.plainPassword, null, {'label_attr': {'class': ''}}) }}
  34.  
  35. {{ form_widget(form.plainPassword, {'attr': {'class': 'form-control'}}) }}
  36.  
  37. </div>
  38.  
  39. <div>
  40. <input class="btn btn-primary" type="submit" value="{{ 'registration.submit'|trans }}" />
  41. </div>
  42. {{ form_end(form) }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement