|
@@ -47,14 +47,14 @@ discard block |
|
|
block discarded – undo |
|
47
|
47
|
{ |
|
48
|
48
|
foreach (array_keys($routesConfig) as $k) { |
|
49
|
49
|
$childRoutes = null; |
|
50
|
|
- if (isset($routesConfig[$k]['child_routes']) && !empty($routesConfig[$k]['child_routes'])) { |
|
51
|
|
- $childRoutes = $routesConfig[$k]['child_routes']; |
|
52
|
|
- unset($routesConfig[$k]['child_routes']); |
|
|
50
|
+ if (isset($routesConfig[ $k ][ 'child_routes' ]) && !empty($routesConfig[ $k ][ 'child_routes' ])) { |
|
|
51
|
+ $childRoutes = $routesConfig[ $k ][ 'child_routes' ]; |
|
|
52
|
+ unset($routesConfig[ $k ][ 'child_routes' ]); |
|
53
|
53
|
} |
|
54
|
54
|
|
|
55
|
|
- $routesConfig[$k]['name'] = $k; |
|
56
|
|
- $route = $this->processRoute($routesConfig[$k], $parentRoute); |
|
57
|
|
- if (!isset($routesConfig[$k]['may_terminate']) || false !== $routesConfig[$k]['may_terminate']) { |
|
|
55
|
+ $routesConfig[ $k ][ 'name' ] = $k; |
|
|
56
|
+ $route = $this->processRoute($routesConfig[ $k ], $parentRoute); |
|
|
57
|
+ if (!isset($routesConfig[ $k ][ 'may_terminate' ]) || false !== $routesConfig[ $k ][ 'may_terminate' ]) { |
|
58
|
58
|
$routeCollection->addRoute($route); |
|
59
|
59
|
} |
|
60
|
60
|
|
|
@@ -74,12 +74,12 @@ discard block |
|
|
block discarded – undo |
|
74
|
74
|
*/ |
|
75
|
75
|
private function processRoute(array $routeConfig, Route $parentRoute = null) |
|
76
|
76
|
{ |
|
77
|
|
- $name = $routeConfig['name']; |
|
78
|
|
- $url = isset($routeConfig['options']['route']) ? $routeConfig['options']['route'] : ''; |
|
79
|
|
- $controller = isset($routeConfig['options']['defaults']['controller']) |
|
80
|
|
- ? $routeConfig['options']['defaults']['controller'] : null; |
|
81
|
|
- $action = isset($routeConfig['options']['defaults']['action']) |
|
82
|
|
- ? $routeConfig['options']['defaults']['action'] : null; |
|
|
77
|
+ $name = $routeConfig[ 'name' ]; |
|
|
78
|
+ $url = isset($routeConfig[ 'options' ][ 'route' ]) ? $routeConfig[ 'options' ][ 'route' ] : ''; |
|
|
79
|
+ $controller = isset($routeConfig[ 'options' ][ 'defaults' ][ 'controller' ]) |
|
|
80
|
+ ? $routeConfig[ 'options' ][ 'defaults' ][ 'controller' ] : null; |
|
|
81
|
+ $action = isset($routeConfig[ 'options' ][ 'defaults' ][ 'action' ]) |
|
|
82
|
+ ? $routeConfig[ 'options' ][ 'defaults' ][ 'action' ] : null; |
|
83
|
83
|
|
|
84
|
84
|
if (null !== $parentRoute) { |
|
85
|
85
|
$name = $parentRoute->getName() . '/' . $name; |