Welcome Guest, Not a member yet? Register   Sign In
Controllers under subfolder
#25

(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.

Listening to your feedback, I've gone back and fixed one issue that was keeping non-namespaced controllers from being auto-routed last night. Though I'm trying to find a nice way to make it testable currently. Smile And I will be working on making auto-routing working with namespaces - as long as that namespace lands in the controllers folder, anyway.

So - thanks for the feedback! And, have patience, we'll work the bugs out. Smile
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.
Reply


Messages In This Thread
Controllers under subfolder - by fromberg - 06-30-2016, 10:40 PM
RE: Controllers under subfolder - by sv3tli0 - 06-30-2016, 11:53 PM
RE: Controllers under subfolder - by InsiteFX - 07-01-2016, 04:08 AM
RE: Controllers under subfolder - by titounnes - 07-01-2016, 01:20 PM
RE: Controllers under subfolder - by arma7x - 07-01-2016, 02:12 PM
RE: Controllers under subfolder - by titounnes - 07-01-2016, 09:20 PM
RE: Controllers under subfolder - by arma7x - 07-02-2016, 12:23 AM
RE: Controllers under subfolder - by fromberg - 07-01-2016, 10:07 PM
RE: Controllers under subfolder - by arma7x - 07-02-2016, 02:06 AM
RE: Controllers under subfolder - by fromberg - 07-02-2016, 07:24 AM
RE: Controllers under subfolder - by arma7x - 07-02-2016, 07:52 AM
RE: Controllers under subfolder - by sv3tli0 - 07-02-2016, 01:02 AM
RE: Controllers under subfolder - by titounnes - 07-02-2016, 03:40 AM
RE: Controllers under subfolder - by arma7x - 07-02-2016, 04:27 AM
RE: Controllers under subfolder - by arma7x - 07-02-2016, 04:05 AM
RE: Controllers under subfolder - by titounnes - 09-26-2019, 03:46 AM
RE: Controllers under subfolder - by InsiteFX - 07-02-2016, 03:19 AM
RE: Controllers under subfolder - by kilishan - 07-05-2016, 08:42 PM
RE: Controllers under subfolder - by andybiancoblu - 09-26-2019, 03:17 AM
RE: Controllers under subfolder - by InsiteFX - 07-10-2016, 04:59 AM
RE: Controllers under subfolder - by arma7x - 07-10-2016, 06:33 AM
RE: Controllers under subfolder - by InsiteFX - 07-10-2016, 07:00 AM
RE: Controllers under subfolder - by arma7x - 07-10-2016, 07:17 AM
RE: Controllers under subfolder - by InsiteFX - 07-10-2016, 01:01 PM
RE: Controllers under subfolder - by mwhitney - 07-27-2016, 09:23 AM
RE: Controllers under subfolder - by InsiteFX - 09-26-2019, 03:42 AM
RE: Controllers under subfolder - by InsiteFX - 09-26-2019, 04:37 AM
RE: Controllers under subfolder - by InsiteFX - 09-26-2019, 12:40 PM
RE: Controllers under subfolder - by InsiteFX - 09-26-2019, 07:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB