Skip to content

Commit 73606a6

Browse files
Merge branch '3.3' into 3.4
* 3.3: [FrameworkBundle] Fix bad interface hint in AbstractController [DI] Improve some deprecation messages [Cache] Fix race condition in TagAwareAdapter [Yaml] parse references on merge keys treat trailing backslashes in multi-line strings
2 parents c0bd749 + f440e16 commit 73606a6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Controller/ControllerTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,18 +281,18 @@ protected function renderView($view, array $parameters = array())
281281
protected function render($view, array $parameters = array(), Response $response = null)
282282
{
283283
if ($this->container->has('templating')) {
284-
return $this->container->get('templating')->renderResponse($view, $parameters, $response);
285-
}
286-
287-
if (!$this->container->has('twig')) {
284+
$content = $this->container->get('templating')->render($view, $parameters);
285+
} elseif ($this->container->has('twig')) {
286+
$content = $this->container->get('twig')->render($view, $parameters);
287+
} else {
288288
throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available.');
289289
}
290290

291291
if (null === $response) {
292292
$response = new Response();
293293
}
294294

295-
$response->setContent($this->container->get('twig')->render($view, $parameters));
295+
$response->setContent($content);
296296

297297
return $response;
298298
}

Tests/Controller/ControllerTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public function testRenderViewTemplating()
451451
public function testRenderTemplating()
452452
{
453453
$templating = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface')->getMock();
454-
$templating->expects($this->once())->method('renderResponse')->willReturn(new Response('bar'));
454+
$templating->expects($this->once())->method('render')->willReturn('bar');
455455

456456
$container = new Container();
457457
$container->set('templating', $templating);

0 commit comments

Comments
 (0)