$templates = array(); 4. foreach ($this->cmsManager->getPageManager()->getTemplates() as $code => $template) { 5. $templates[$code] = $template->getName(); 6. } 7. 8. $formMapper 9. ->with($this->trans('form_page.group_main_label')) 10. ->add('name') 11. ->add('enabled', null, array('required' => false)) 12. ->add('position') 13. ->add('templateCode', 'choice', array('required' => true, 'choices' => $templates)) 14. ->add('parent', 'sonata_page_selector', array( 15. 'page' => $this->getSubject() ?: null, 16. 'model_manager' => $this->getModelManager(), 17. 'class' => $this->getClass(), 18. 'filter_choice' => array('hierarchy' => 'root'), 19. 'required' => false 20. )) 21. ->end() 22. ; 23. 24. $formMapper 25. ->with($this->trans('form_page.group_seo_label'), array('collapsed' => true)) 26. ->add('metaKeyword', 'textarea', array('required' => false)) 27. ->add('metaDescription', 'textarea', array('required' => false)) 28. ->end() 29. ; 30. 31. $formMapper 32. ->with($this->trans('form_page.group_advanced_label'), array('collapsed' => true)) 33. ->add('javascript', null, array('required' => false)) 34. ->add('stylesheet', null, array('required' => false)) 35. ->add('rawHeaders', null, array('required' => false)) 36. ->end() 37. ; 38. 39. $formMapper->setHelps(array( 40. 'name' => $this->trans('help_page_name') 41. )); 42. } create group Form Component Define help messages group options