Skip to content

Commit

Permalink
[FrameworkBundle] deprecated HttpKernel::forward() (it is only used o…
Browse files Browse the repository at this point in the history
…nce now and not part of any interface anyway)
  • Loading branch information
fabpot committed Jan 10, 2013
1 parent 1240690 commit a8ea4e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ public function generateUrl($route, $parameters = array(), $referenceType = UrlG
*/
public function forward($controller, array $path = array(), array $query = array())
{
return $this->container->get('http_kernel')->forward($controller, $path, $query);
$path['_controller'] = $controller;
$subRequest = $this->container->get('request')->duplicate($query, null, $path);

return $this->container->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
* @param array $query An array of request query parameters
*
* @return Response A Response instance
*
* @deprecated in 2.2, will be removed in 2.3
*/
public function forward($controller, array $attributes = array(), array $query = array())
{
trigger_error('forward() is deprecated since version 2.2 and will be removed in 2.3.', E_USER_DEPRECATED);

$attributes['_controller'] = $controller;
$subRequest = $this->container->get('request')->duplicate($query, null, $attributes);

Expand Down

0 comments on commit a8ea4e4

Please sign in to comment.