8000 [WIP] Kernel refactor by fabpot · Pull Request #6459 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[FrameworkBundle] deprecated HttpKernel::forward() (it is only used o…
…nce now and not part of any interface anyway)
  • Loading branch information
fabpot committed Jan 10, 2013
commit a8ea4e4b10fca40b6283f6a7ec29fb62062cf2bd
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ou should add trigger_error

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and what would be the replacement ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. There is no replacements.

*/
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