Permalink
Browse files

Fixed the Router to accept all-lowercase URI parts as well

  • Loading branch information...
Alexander Pánek
Alexander Pánek committed Mar 18, 2013
1 parent 3dc9006 commit 9f0ac88a9c7ce5d4af1cd9c04121b9158288c551
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/Bacon/Router.php
@@ -37,15 +37,15 @@ public function parse ()
$current = $splitted_uri[$i];
$next = $i + 1 < $count ? $splitted_uri[$i + 1] : '';
$path = \Sauce\Path::join(APP_ROOT, 'Controllers', $this->route, $current);
$path = \Sauce\Path::join(APP_ROOT, 'Controllers', $this->route, ucfirst($current));
if (is_dir($path) && is_file(\Sauce\Path::join($path, $next . '.php'))) {
if (is_dir($path) && is_file(\Sauce\Path::join($path, ucfirst($next) . '.php'))) {
// Current part is a namespace
$this->route->push($current);
$this->route->push(ucfirst($current));
} elseif (is_file($path . '.php')) {
// Current part is a resource
$this->route->push($current);
$this->route->push(ucfirst($current));
if (empty($next)) {
// No next part -> call current#index or #create

0 comments on commit 9f0ac88

Please sign in to comment.