![]() |
I have different custom module paths/namespaces in my CodeIgniter4 project, and I just recently upgraded to version 4.4.0. In this upgrade the route settings will move from Config/Routes.php to Config/Routing.php file.
Now while I load my modules/namespace routes, my module routes are not identified because the $defaultNamespace setup is now in a different file.
How can I handle this?
I have added the Routes path to the $routesFiles parameter in the Routing.php Code: public array $routeFiles = [
If there is an Acme module in the acme/ folder, then Routes.php it will be automatically added from acme/Config/Routes.php
Why are you using different delimiters in the path?
(02-12-2025, 07:11 AM)ozornick Wrote: If there is an Acme module in the acme/ folder, then Routes.php it will be automatically added from acme/Config/Routes.php even with the same delimiters, my routes still cannot be reached; it keeps throwing page not found when I visit any of the defined routes in the custom modules
Look at the output of the spark command, maybe you made a mistake with NS? At least the full path to the files must be specified ROOTPATH . "feemodule/Config/Routes.php".
Show how you installed namespace: composer.json or Autoload, Constants. Everything works, you made a mistake somewhere.
First, there is no need to include the Route files in the $routeFiles since the modules are autoloaded and the Routes are autodiscovered.
But in each of the custom module config path, I included the Services.php file and in the Routes.php files, I brought back the former routes settings with the appropriate namespace to each of these files in BudgetingModule\Config\Routes.php file PHP Code: namespace BudgetingModule\Config; (02-12-2025, 10:48 AM)ozornick Wrote: Look at the output of the spark command, maybe you made a mistake with NS? At least the full path to the files must be specified ROOTPATH . "feemodule/Config/Routes.php". Thanks a whole lot for your responses
I think you are using routes incorrectly. You are overwriting $routes->set*() and your next routes may have incorrect parameters. Please specify them as $routes->group("", ["namespace" => ...])
Set global options only general module - App
(02-12-2025, 01:25 PM)ozornick Wrote: I think you are using routes incorrectly. You are overwriting $routes->set*() and your next routes may have incorrect parameters. Please specify them as $routes->group("", ["namespace" => ...]) Thank you very much will update that
This is how mine are setup and working.
PHP Code: // app/Config/Autoload.php PHP Code: // InsiteFX\Blog\Config\Route.php What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |