You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a route isn't defined, the controllerName() function in service('router') returns an expected string like 'App\Controllers{controllername}'. But when a route is defined in the routes.php it also returns an extra \ like '\App\Controllers{controllername}'.
CodeIgniter 4 version
CodeIgniter 4 RC 3 zip version
CodeIgniter 4 Dev starter composer
CodeIgniter 4 App starter composer
Affected module(s)
Probably the router service
Expected behavior, and steps to reproduce if appropriate
Let the namespace define the route, and return the controller name using $router = service("router"); echo $router->controllerName();
It should return the namespace of the controller with the name.
Now define the route in routes.php, and the same code will return an \ with the namespace of the controller with the controllername.
I expected them to be the same.
The text was updated successfully, but these errors were encountered:
chriseilander
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Jan 29, 2020
chriseilander
changed the title
Bug: router service adds backspace to controllername if route is configured
Bug: router service adds backslash to controllername if route is configured
Jan 29, 2020
Describe the bug
When a route isn't defined, the controllerName() function in service('router') returns an expected string like 'App\Controllers{controllername}'. But when a route is defined in the routes.php it also returns an extra \ like '\App\Controllers{controllername}'.
CodeIgniter 4 version
CodeIgniter 4 RC 3 zip version
CodeIgniter 4 Dev starter composer
CodeIgniter 4 App starter composer
Affected module(s)
Probably the router service
Expected behavior, and steps to reproduce if appropriate
Let the namespace define the route, and return the controller name using
$router = service("router"); echo $router->controllerName();
It should return the namespace of the controller with the name.
Now define the route in routes.php, and the same code will return an \ with the namespace of the controller with the controllername.
I expected them to be the same.
The text was updated successfully, but these errors were encountered: