Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. $form = $this->createFormBuilder();
  2. $registration = $this->get('form.factory')->createNamedBuilder('registration');
  3. $questionary = $this->get('form.factory')->createNamedBuilder('questionary');
  4.  
  5. $registration
  6. ->add('name', 'text')
  7. ->add('city', 'text')
  8. ;
  9.  
  10. $questionary
  11. ->add('question_1', 'text')
  12. ->add('question_2', 'choice', array(
  13. 'choices' => array('female', 'male')
  14. ))
  15. ;
  16.  
  17. $form->add($registration);
  18. $form->add($questionary);
  19. ?>
  20.  
  21. {{ form_row(form.registration) }}
  22. {{ form_row(form.questionary) }}
  23.  
  24. <?
  25. $data = $form->getData();
  26. $registration = $data['registration'];
  27. $questionary = $data['questionary'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement