Created
October 12, 2012 01:17
-
-
Save benglass/3876801 to your computer and use it in GitHub Desktop.
Symfony 2 Collection Form Type Showing Related Model Data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## in QcProjectType::buildForm | |
->add('projectTasks', 'collection', array( | |
'type' => new QcProjectTaskType() | |
)) | |
## in view template | |
{% for project_task in form.projectTasks %} | |
{{ project_task.task.name }} | |
{{ form_widget(project_task.task) }} | |
{{ form_widget(project_task.status) }} | |
{{ form_widget(project_task.initials) }} | |
{{ form_widget(project_task.comments) }} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment