I suggest two options:
If the
name
is not mandatory in your routing you can change your routing as belowupdate_page: pattern: /updatePage/{name} defaults: { _controller: MyCrudBundle:updateElement:update, name: null }
If the
name
is mandatory for the generated url you need to pass thename
as the pattern paramif ($formupdate->isValid()) { $newval = $formupdate->getData(); $namevalue= $newval->getName(); $quantityvalue= $newval->getQuantity(); $element->setName($namevalue); $element->setQuantity($quantityvalue); $em->flush(); return new RedirectResponse($this->generateUrl('update_page', array('name' => $name))); }
base on your query selection you have in your controller the $name
is mandatory and I suggest to try the second one