我有这个路线:
nueva_ventau:
pattern: /ventau/{id}
defaults: { _controller: miomioBundle:Usuario:ventau, _format: pdf}
options:
expose: true
如何使用格式重定向响应?
if ($pieces[0] == 0)//html
return new RedirectResponse($this->generateUrl('homepage')); ??????????????
else
return $this->forward('miomioBundle:Venta:hello', array('id' => $venta->getId()));
答案 0 :(得分:2)
来自docs,在控制器中:
return $this->redirect(
$this->generateUrl('nueva_ventau', array('id' => $venta->getId())
);