php render和redirect,php – $this-> render和$this-> redirect Symfony2之间的区别

$this-> render和$this-> redirect之间有什么区别?有没有办法可以通过$this->渲染传递参数,就像我使用$this->重定向一样

return $this->render('MedicineUserBundle:User:home.html.twig', array(

'info' => $all,));

我可以这样做: –

return $this->redirect($this->generateUrl('MedicineUserBundle_login', array(

'info' => $all,)));

或者是否有任何其他方式我可以使用$this->重定向到我的模板twig文件传递值.

还有一个问题我如何用$this->重定向更改网址,例如,如果我不必将任何值传递给我的模板文件,我可以像上面提到的那样将渲染带到像localhost / myproject /这样的页面home但是$ – > this-> redirect将执行控制器,但url将与localhost / myproject /相同.无论如何我可以使用重定向重定向到另一个URL