Skip to content

Commit a8ea4e4

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

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines 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

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy