-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with subfolder controller structure like admin folder #12
Comments
Hi, sorry about the delay, I was on vacation. About your problem, this example works fine for me. So. It can be a problem with the route index.php, or that the controller's file name it's "dashboard" instead of "Dashboard", or maybe you are not calling "Route::map()" ? If everything's okay tell me and we will see what could be the specific problem. |
Also, check it without the anonymous function like Route::any('admin/dashboard', 'admin/dashboard/method'); It could be a problem with the php version and the anonymous functions? |
Hi Patroklo Actually i have folder structure ike below
Now, take some scenario like, we need to show Dashboard after login. Default codeigniter will works for the below link without placing any routes.. In the same way, is it possible with this codeigniter-static-laravel-routes library.. This link should work: http://localhost/ci/admin/dashboard/ Is Below thing possible?? Without breaking any links, is it possible to change Admin folder name ? ( Admin -to- sp-admin ) |
Hi Route::any('admin/(:any)', 'admin/dashboard/$1'); And then every string in any will go to its method in Dashboard controller. |
Obviously, if method doesnt exist, it will throw a error calling a method, not a 404, so its up to you to change that into a 404. I can suggest you to use a filter that detects if a method exist and if it doesnt, make a show_404(); |
Hi
Iam first time using this advanced routing system on Codeigniter..
Something like regular ci, working code: $route['admin'] = 'admin/account/login'
After login, i need open another controller which is present on Admin folder. ie., admin/Dashboard.php
i placed below code:
Route::prefix('admin', function() {
Route::get('dashboard', 'admin/dashboard/method');
});
Test URL request something like:
http://localhost/ci/admin/dashboard/
Iam getting 404errors. (i placed htaccess code also remove index.php from url)
Please can suggest where i did wrong
The text was updated successfully, but these errors were encountered: