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
There's not a bug there. When you're specifying the "to" portion of the route, users/34 it expects the last, non-placeholder segment, to be the method called. I'm guessing the 34 is supposed to be the ID of the user or post? In that case you need a placeholder to accept the ID from the URL and pass it as an argument to the method.
$routes->add('blog/joe/{id}', 'Blogs::users/$1');
Please read the user guide for more information, or ask at the forum for help.
Describe the bug
https://codeigniter4.github.io/CodeIgniter4/incoming/routing.html
But actually the method is
users/34
visit page show 404
CodeIgniter 4 version
version 4.0.0-alpha.3
Affected module(s)
Routes
Expected behavior, and steps to reproduce if appropriate
In
application/Config/Routes.php
set:In
application/Controllers/Blogs.php
set:visit
/blog/joe
and/blogs/users/34
should showbut visit
/blog/joe
showThe text was updated successfully, but these errors were encountered: