0

我有这个路由:

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()));
4

1 回答 1

2

docs,在控制器中:

return $this->redirect(
    $this->generateUrl('nueva_ventau', array('id' => $venta->getId())
);
于 2012-11-07T15:30:31.937 回答