mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Get routing working in sub-directories.
This commit is contained in:
parent
1f275847dd
commit
5b62fad76c
@ -141,6 +141,11 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! class_exists($controller))
|
||||
{
|
||||
require APPPATH.'controllers/'.$router->directory().$router->controllerName().'.php';
|
||||
}
|
||||
|
||||
$class = new $controller($request, $response);
|
||||
$method = $router->methodName();
|
||||
$class->$method(...$router->params());
|
||||
|
@ -249,7 +249,7 @@ class Router implements RouterInterface
|
||||
}
|
||||
|
||||
// If not empty, then the first segment should be the controller
|
||||
$this->controller = $segments[0];
|
||||
$this->controller = ucfirst($segments[0]);
|
||||
|
||||
// Use the method name if it exists.
|
||||
// If it doesn't, no biggie - the default method name
|
||||
|
Loading…
x
Reference in New Issue
Block a user