Controller in for sub-directory - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Controller in for sub-directory (/showthread.php?tid=74298) |
Controller in for sub-directory - mintwint - 09-07-2019 Hello! I try create controller in sub-directory, but get 404 error. I just follow documentation https://codeigniter4.github.io/CodeIgniter4/incoming/controllers.html#organizing-your-controllers-into-sub-directories and create folder "one" and file in folder "Hello.php": PHP Code: <?php namespace App\Controllers; App/Controllers/one/hello/method Codeigniter has been installed in sub-directory site.com/backend Now i try call controller by link site.com/backend/one/hello/method and i get 404 error - "Controller or its method is not found: App\Controllers\One::hello". How to create controller files correctly in sub-diectory? Thank you! RE: Controller in for sub-directory - ciadmin - 09-07-2019 Your Hello controller needs the proper namespace ... Code: <?php namespace App\Controllers\one; RE: Controller in for sub-directory - mintwint - 09-07-2019 (09-07-2019, 05:50 AM)ciadmin Wrote: Your Hello controller needs the proper namespace ... Thank you! It worked! |