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 a8ea4e4

Browse filesBrowse files
committed
[FrameworkBundle] deprecated HttpKernel::forward() (it is only used once now and not part of any interface anyway)
1 parent 1240690 commit a8ea4e4
Copy full SHA for a8ea4e4

File tree

2 files changed

+8
-1
lines changed
Filter options

2 files changed

+8
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ public function generateUrl($route, $parameters = array(), $referenceType = UrlG
5959
*/
6060
public function forward($controller, array $path = array(), array $query = array())
6161
{
62-
return $this->container->get('http_kernel')->forward($controller, $path, $query);
62+
$path['_controller'] = $controller;
63+
$subRequest = $this->container->get('request')->duplicate($query, null, $path);
64+
65+
return $this->container->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
6366
}
6467

6568
/**

‎src/Symfony/Bundle/FrameworkBundle/HttpKernel.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
6565
* @param array $query An array of request query parameters
6666
*
6767
* @return Response A Response instance
68+
*
69+
* @deprecated in 2.2, will be removed in 2.3
6870
*/
6971
public function forward($controller, array $attributes = array(), array $query = array())
7072
{
73+
trigger_error('forward() is deprecated since version 2.2 and will be removed in 2.3.', E_USER_DEPRECATED);
74+
7175
$attributes['_controller'] = $controller;
7276
$subRequest = $this->container->get('request')->duplicate($query, null, $attributes);
7377

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.