Welcome Guest, Not a member yet? Register   Sign In
How to make and include different routing files inside one route file?
#6

(This post was last modified: 04-25-2023, 09:48 AM by Corsari.)

Hello
this demo
https://github.com/michalsn/codeigniter-htmx-demo
displaces an additional Routes.php file in a separate path and it works
in particular it goes in a subfolder where the whole demo is encapsulated

Code:
/App/ThirdParty/htmx-demo/src/Config/Routes.php

though I have not enough knowledge to explain why and how it works
As stated in the above github page, the unique modification done is in the /App/Config/Autoload.php where in the $psr4 it is added the respective namespace

Code:
public $psr4 = [
    APP_NAMESPACE => APPPATH, // For custom app namespace
    'Config'      => APPPATH . 'Config',
    'Michalsn\CodeIgniterHtmxDemo' => APPPATH . 'ThirdParty/htmx-demo/src',
];

what is fantastic for my really limited knowledge of CodeIgniter , is that the default installation of CodeIgniter remains untouched and the parallel subtree unzipped in /App/ThirdParty works

About the additional Routes.php , it works because of the Auto-Discovery https://www.codeigniter.com/user_guide/g...-discovery
Reply


Messages In This Thread
RE: How to make and include different routing files inside one route file? - by Corsari - 04-25-2023, 05:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB