|
@@ -35,18 +35,19 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|
|
$allow = array_merge($allow, array('get', 'head'));
|
|
|
goto not_bar;
|
|
|
}
|
|
|
- return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'bar'));
|
|
|
+ $matches['_route'] = 'bar';
|
|
|
+ return $matches;
|
|
|
}
|
|
|
not_bar:
|
|
|
|
|
|
// baz
|
|
|
if ($pathinfo === '/test/baz') {
|
|
|
- return array_merge($this->mergeDefaults(array(), array ()), array('_route' => 'baz'));
|
|
|
+ return array('_route' => 'baz');
|
|
|
}
|
|
|
|
|
|
// baz2
|
|
|
if ($pathinfo === '/test/baz.html') {
|
|
|
- return array_merge($this->mergeDefaults(array(), array ()), array('_route' => 'baz2'));
|
|
|
+ return array('_route' => 'baz2');
|
|
|
}
|
|
|
|
|
|
// baz3
|
|
@@ -54,7 +55,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|
|
if (substr($pathinfo, -1) !== '/') {
|
|
|
return array('_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'url' => $this->context['base_url'].$pathinfo.'/', 'permanent' => true, '_route' => 'baz3');
|
|
|
}
|
|
|
- return array_merge($this->mergeDefaults(array(), array ()), array('_route' => 'baz3'));
|
|
|
+ return array('_route' => 'baz3');
|
|
|
}
|
|
|
|
|
|
// baz4
|
|
@@ -62,7 +63,8 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|
|
if (substr($pathinfo, -1) !== '/') {
|
|
|
return array('_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'url' => $this->context['base_url'].$pathinfo.'/', 'permanent' => true, '_route' => 'baz4');
|
|
|
}
|
|
|
- return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'baz4'));
|
|
|
+ $matches['_route'] = 'baz4';
|
|
|
+ return $matches;
|
|
|
}
|
|
|
|
|
|
// baz5
|
|
@@ -74,7 +76,8 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|
|
if (substr($pathinfo, -1) !== '/') {
|
|
|
return array('_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'url' => $this->context['base_url'].$pathinfo.'/', 'permanent' => true, '_route' => 'baz5');
|
|
|
}
|
|
|
- return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'baz5'));
|
|
|
+ $matches['_route'] = 'baz5';
|
|
|
+ return $matches;
|
|
|
}
|
|
|
not_baz5:
|
|
|
|
|
@@ -87,10 +90,16 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|
|
if (substr($pathinfo, -1) !== '/') {
|
|
|
return array('_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'url' => $this->context['base_url'].$pathinfo.'/', 'permanent' => true, '_route' => 'baz.baz6');
|
|
|
}
|
|
|
- return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'baz.baz6'));
|
|
|
+ $matches['_route'] = 'baz.baz6';
|
|
|
+ return $matches;
|
|
|
}
|
|
|
not_bazbaz6:
|
|
|
|
|
|
+ // foofoo
|
|
|
+ if ($pathinfo === '/foofoo') {
|
|
|
+ return array ( 'def' => 'test', '_route' => 'foofoo',);
|
|
|
+ }
|
|
|
+
|
|
|
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new NotFoundException();
|
|
|
}
|
|
|
}
|