Skip to content

Commit 00152ef

Browse files
committed
Update Router. Bug fixed.
1 parent 0014873 commit 00152ef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function group($name, $settings = null, $callback = null)
341341
*/
342342
public function controller($route, $controller)
343343
{
344-
$controllerFile = realpath($this->paths['controllers'] . strtolower($controller) . '.php');
344+
$controllerFile = realpath($this->paths['controllers'] . str_replace('\\','/',$controller) . '.php');
345345

346346
if(file_exists($controllerFile))
347347
{

src/Router/RouterCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function runRoute($command, $params = null, $path = '', $namespace = '')
105105
$parts = explode('/', $command);
106106
$segments = explode('@', end($parts));
107107

108-
$controllerFile = realpath($path . (str_replace($namespace, '', $segments[0])) . '.php');
108+
$controllerFile = realpath($path . (str_replace([$namespace, '\\'], ['', '/'], $segments[0])) . '.php');
109109

110110
if(count($parts) > 1)
111111
$controllerFile = realpath($path . $parts[0] . '/' . ($segments[0]).'.php');

0 commit comments

Comments
 (0)