Skip to content

Commit

Permalink
AutoRoute should collect parameters, silly. Fixes #45
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed Mar 31, 2016
1 parent b113742 commit c49b5b2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions system/Router/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,20 @@ public function autoRoute(string $uri)
// If not empty, then the first segment should be the controller
else
{
$this->controller = ucfirst($segments[0]);
$this->controller = ucfirst(array_shift($segments));
}

// Use the method name if it exists.
// If it doesn't, no biggie - the default method name
// has already been set.
if (! empty($segments[1]))
if (! empty($segments))
{
$this->method = $segments[1];
$this->method = array_shift($segments);
}

if (! empty($segments))
{
$this->params = $segments;
}
}

Expand Down

0 comments on commit c49b5b2

Please sign in to comment.