![]() |
Using and namespacing 'modules' - 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: Using and namespacing 'modules' (/showthread.php?tid=76140) |
Using and namespacing 'modules' - Zeff - 04-16-2020 UPDATE - 2020-04-20 I changed App\Config\Autoload.php to: PHP Code: <?php namespace Config; Added a route for the start module in App\Config\Routes.php: PHP Code: // We get a performance increase by specifying the default PHP Code: <?php When I open http://localhost/ci4-test/start --> Bingo! It works But when I open http://localhost/ci4-test/start/foo: 404 - 'Controller or its method is not found: App\Controllers\Start::foo' Is there something wrong in my routing file? Thanks for any help or suggestion! _____________ Yesterday, I was playing around with namespaces in a test application but it won't work out... I created a subfolder 'Start' within 'App\Modules' (namespaced as 'Mine' in autoloader.php - see lower) In namespaced the controller and added the namespace to the autoloader: But it looks like the regular App\Controllers\ route is still followed... Any idea what I'm doing wrong? Many tanks in advance! Zeff |