| @@ 124-137 (lines=14) @@ | ||
| 121 | * @Method("GET") |
|
| 122 | * @Template() |
|
| 123 | */ |
|
| 124 | public function editAction(Article $article) |
|
| 125 | { |
|
| 126 | $editForm = $this->createForm(new ArticleType(), $article, array( |
|
| 127 | 'action' => $this->generateUrl('articles_update', array('slug' => $article->getSlug())), |
|
| 128 | 'method' => 'PUT', |
|
| 129 | )); |
|
| 130 | $deleteForm = $this->createDeleteForm($article->getId(), 'articles_delete'); |
|
| 131 | ||
| 132 | return array( |
|
| 133 | 'article' => $article, |
|
| 134 | 'edit_form' => $editForm->createView(), |
|
| 135 | 'delete_form' => $deleteForm->createView(), |
|
| 136 | ); |
|
| 137 | } |
|
| 138 | ||
| 139 | /** |
|
| 140 | * Edits an existing Article entity. |
|
| @@ 126-148 (lines=23) @@ | ||
| 123 | * @Method("GET") |
|
| 124 | * @Template() |
|
| 125 | */ |
|
| 126 | public function editAction(Group $group) |
|
| 127 | { |
|
| 128 | $editForm = $this->createForm( |
|
| 129 | new GroupType(), |
|
| 130 | $group, |
|
| 131 | array( |
|
| 132 | 'action' => $this->generateUrl( |
|
| 133 | 'group_update', |
|
| 134 | array('id' => $group->getId()) |
|
| 135 | ), |
|
| 136 | 'method' => 'PUT', |
|
| 137 | ) |
|
| 138 | ); |
|
| 139 | $this->addRoles($editForm, $group); |
|
| 140 | ||
| 141 | $deleteForm = $this->createDeleteForm($group->getId(), 'group_delete'); |
|
| 142 | ||
| 143 | return array( |
|
| 144 | 'group' => $group, |
|
| 145 | 'edit_form' => $editForm->createView(), |
|
| 146 | 'delete_form' => $deleteForm->createView(), |
|
| 147 | ); |
|
| 148 | } |
|
| 149 | ||
| 150 | /** |
|
| 151 | * Edits an existing Group entity. |
|