Controllers under subfolder |
(07-05-2016, 08:42 PM)kilishan Wrote: Thanks to this thread I have identified a couple of issues with the Routing. In part, was my original assumptions turned out incorrect - I thought the two philosophies would be used separately. Either you had a namespaced controller that was specified in the routes file, or the auto-routed version to stuff in the controller folder, where the classes were in the global namespace.Hi everyone. I've been looking for help also in another thread (https://forum.codeigniter.com/thread-73262.html) but no one could help me. So... I downloaded CI4 and installed it in a docker container with php7.2.1 and set up an apache2 virtualhost with mod_rewrite enabled. Htaccess works fine. I decided to try sub folders separation for my controllers according to documentation: https://codeigniter4.github.io/CodeIgnit...irectories Namespaced my controllers with App/Controllers/subfoldername Tried accessing with the url myenv.local/subfioldername/controllername/method Always geting a 404 error saying: 404 - File Not Found Controller or its method is not found: {0}::{1} Am I missing something? Do I need to map with $routes->add every single class and method in subfolder in the form of PHP Code: $routes->add('subfoldername/class', 'class::method', ['namespace' => 'App\Controllers\subfoldername']); Because if it is like this seems to me a little to verbose... Thanks in advance for any help! I'm stuck with this issue and I can't go on developing. I love CI and love even more CI4 (I find its philosophy perfect and modern!!) Please don'0t make me migrate on a different php framework! Sincerely
[Image: https://vulndetect.org/assets/uploads/fi...docker.ico]
Andy Biancoblu Quote:Once you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
Welcome Guest, Not a member yet? Register Sign In |