Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5d29dd0

Browse filesBrowse files
[FrameworkBundle] Fix bad interface hint in AbstractController
1 parent 0a963d2 commit 5d29dd0
Copy full SHA for 5d29dd0

File tree

2 files changed

+6
-6
lines changed
Filter options

2 files changed

+6
-6
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,18 @@ protected function renderView($view, array $parameters = array())
231231
protected function render($view, array $parameters = array(), Response $response = null)
232232
{
233233
if ($this->container->has('templating')) {
234-
return $this->container->get('templating')->renderResponse($view, $parameters, $response);
235-
}
236-
237-
if (!$this->container->has('twig')) {
234+
$content = $this->container->get('templating')->render($view, $parameters);
235+
} elseif ($this->container->has('twig')) {
236+
$content = $this->container->get('twig')->render($view, $parameters);
237+
} else {
238238
throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available.');
239239
}
240240

241241
if (null === $response) {
242242
$response = new Response();
243243
}
244244

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

247247
return $response;
248248
}

‎src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.