[WebBundle] added a Response parameter to the send() method
This commit is contained in:
parent
b5089133d2
commit
9cf78e637b
@ -3,6 +3,7 @@
|
||||
namespace Symfony\Framework\WebBundle;
|
||||
|
||||
use Symfony\Components\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Components\RequestHandler\Response;
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony framework.
|
||||
@ -96,14 +97,19 @@ class Controller
|
||||
/**
|
||||
* Renders a view.
|
||||
*
|
||||
* @param string $view The view name
|
||||
* @param array $parameters An array of parameters to pass to the view
|
||||
* @param string $view The view name
|
||||
* @param array $parameters An array of parameters to pass to the view
|
||||
* @param Response $response A response instance
|
||||
*
|
||||
* @return Response A Response instance
|
||||
*/
|
||||
public function render($view, array $parameters = array())
|
||||
public function render($view, array $parameters = array(), Response $response = null)
|
||||
{
|
||||
$response = $this->container->getResponseService();
|
||||
if (null === $response)
|
||||
{
|
||||
$response = $this->container->getResponseService();
|
||||
}
|
||||
|
||||
$response->setContent($this->container->getTemplatingService()->render($view, $parameters));
|
||||
|
||||
return $response;
|
||||
|
Reference in New Issue
Block a user