[WebBundle] added a Response parameter to the send() method

This commit is contained in:
Fabien Potencier 2010-04-24 09:38:10 +02:00
parent b5089133d2
commit 9cf78e637b
1 changed files with 10 additions and 4 deletions

View File

@ -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;