Skip to content

Commit 6b35845

Browse files
committed
Fix #250: Replace form type object with class name string
1 parent b5e8d84 commit 6b35845

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/AppBundle/Controller/Admin/BlogController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function newAction(Request $request)
7474
$post->setAuthorEmail($this->getUser()->getEmail());
7575

7676
// See http://symfony.com/doc/current/book/forms.html#submitting-forms-with-multiple-buttons
77-
$form = $this->createForm(new PostType(), $post)
77+
$form = $this->createForm('AppBundle\Form\PostType', $post)
7878
->add('saveAndCreateNew', 'submit');
7979

8080
$form->handleRequest($request);
@@ -146,7 +146,7 @@ public function editAction(Post $post, Request $request)
146146

147147
$entityManager = $this->getDoctrine()->getManager();
148148

149-
$editForm = $this->createForm(new PostType(), $post);
149+
$editForm = $this->createForm('AppBundle\Form\PostType', $post);
150150
$deleteForm = $this->createDeleteForm($post);
151151

152152
$editForm->handleRequest($request);

src/AppBundle/Controller/BlogController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function postShowAction(Post $post)
7474
*/
7575
public function commentNewAction(Request $request, Post $post)
7676
{
77-
$form = $this->createForm(new CommentType());
77+
$form = $this->createForm('AppBundle\Form\CommentType');
7878

7979
$form->handleRequest($request);
8080

@@ -111,7 +111,7 @@ public function commentNewAction(Request $request, Post $post)
111111
*/
112112
public function commentFormAction(Post $post)
113113
{
114-
$form = $this->createForm(new CommentType());
114+
$form = $this->createForm('AppBundle\Form\CommentType');
115115

116116
return $this->render('blog/_comment_form.html.twig', array(
117117
'post' => $post,

0 commit comments

Comments
 (0)