fixed guessRoute()
This commit is contained in:
parent
8f82e07429
commit
8c32a8e936
@ -22,8 +22,16 @@ use Symfony\Bundle\FrameworkBundle\Controller\RedirectController;
|
||||
*/
|
||||
class RouterDataCollector extends BaseRouterDataCollector
|
||||
{
|
||||
public function getRoute(Request $request, $controller)
|
||||
public function guessRoute(Request $request, $controller)
|
||||
{
|
||||
if (!$controller instanceof RedirectController) {
|
||||
return parent::guessRoute($request, $controller);
|
||||
}
|
||||
|
||||
if (is_array($controller)) {
|
||||
$controller = $controller[0];
|
||||
}
|
||||
|
||||
if ($controller instanceof RedirectController) {
|
||||
return $request->attributes->get('_route');
|
||||
}
|
||||
|
@ -55,7 +55,6 @@ class ConfigDataCollector extends DataCollector
|
||||
'bundles' => array(),
|
||||
);
|
||||
|
||||
$this->data['bundles'] = array();
|
||||
if (isset($this->kernel)) {
|
||||
foreach ($this->kernel->getBundles() as $name => $bundle) {
|
||||
$this->data['bundles'][$name] = $bundle->getPath();
|
||||
|
@ -47,12 +47,7 @@ class RouterDataCollector extends DataCollector
|
||||
$this->data['url'] = $response->getTargetUrl();
|
||||
|
||||
if ($this->controllers->contains($request)) {
|
||||
$controller = $this->controllers[$request];
|
||||
if (is_array($controller)) {
|
||||
$controller = $controller[0];
|
||||
}
|
||||
|
||||
$this->data['route'] = $this->guessRoute($request, $controller);
|
||||
$this->data['route'] = $this->guessRoute($request, $this->controllers[$request]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user