Skip to content

Commit

Permalink
Quick fix for named routes
Browse files Browse the repository at this point in the history
  • Loading branch information
VeeeneX committed Jul 28, 2015
1 parent 0f3bad4 commit 46cc553
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Router/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ protected function parseUriRoute($routes, &$Router, $base = "")
{
foreach ($routes as $pattern => $data) {
if (key($data) === 0) {
$Router->addRoute($data[0], $base.$pattern, $data[1]);
$name = null;
if (isset($data[2])) {
$name = $data[2];
}
$Router->addRoute($data[0], $base.$pattern, $data[1], $name);
} else {
$this->parseUriRoute($data, $Router, $pattern);
}
Expand All @@ -55,10 +59,6 @@ protected function parseMethodRoute($routes, &$Router)
{
foreach ($routes as $method => $routesInMethod) {
foreach ($routesInMethod as $route) {
$name = null;
if (isset($route[2])) {
$name = $route[2];
}
$Router->addRoute($method, $route[0], $route[1], $name);
}
}
Expand Down

0 comments on commit 46cc553

Please sign in to comment.