Skip to content

Commit

Permalink
Fixed post and put templates for Symfony3 compatibility
Browse files Browse the repository at this point in the history
* Fixed post and put templates for Symfony3 compatibility

* post and put templated fixed for symfony3 and php<5.5 compatibility
  • Loading branch information
ilario-pierbattista authored and davidwdan committed Apr 18, 2016
1 parent d82105f commit 72b61d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -19,7 +19,7 @@
{
{% block method_body %}
$entity = new {{ entity }}();
$form = $this->createForm(new {{ entity }}Type(), $entity, array("method" => $request->getMethod()));
$form = $this->createForm(get_class(new {{ entity }}Type()), $entity, array("method" => $request->getMethod()));
$this->removeExtraFields($request, $form);
$form->handleRequest($request);

Expand Down
Expand Up @@ -21,7 +21,7 @@
try {
$em = $this->getDoctrine()->getManager();
$request->setMethod('PATCH'); //Treat all PUTs as PATCH
$form = $this->createForm(new {{ entity }}Type(), $entity, array("method" => $request->getMethod()));
$form = $this->createForm(get_class(new {{ entity }}Type()), $entity, array("method" => $request->getMethod()));
$this->removeExtraFields($request, $form);
$form->handleRequest($request);
if ($form->isValid()) {
Expand Down

0 comments on commit 72b61d2

Please sign in to comment.