How to link to Ci modules |
Hi, i did a fresh install of CI today and i am trying implement a moduler site but i am stuck.
I have created a Modules folder and inside the modules folder there are 4 modules Admin = admin dashboard and everything admin Auth = user registration/login and everything auth Core = index page and everything site core Users = users accounts, profiles and everything about the user. So i want my core module to be the landing page. e.g if a user visites my site he will land on a page from core module. This is what i have done. i have list all my modules in app/config/autoload like so 'Modules\Core' => APPPATH . 'module/Core', created a Views folder created a Controllers folder created Config folder and all the corresponding folders but they are empty xcept the Controllers and the Views folders i have copied the Home controller to Modules/Core/Controllers and changed the namespace to Modules\Core\Controllers and change the view to ('Modules/Core/Views/welcome_message') I have edited app/config/routes to ('/', '\Modules\Core\Controllers\Home::index'). i am getting 404 sorry, cannot seem to find the your looking for. Thanks in advance.
Sorry, the given link is of course not relevant for modules...
Read: https://codeigniter.com/user_guide/model...ing-models
It seems you are doing good.
Check if there is no typos. And see this repo as a reference. https://github.com/kenjis/ci4-modules-test (10-15-2023, 09:34 AM)JustJohnQ Wrote: Sorry, the given link is of course not relevant for modules...Hi, thanks a lot, for your response, i have followed it very carefully but it's still not working.
1. Modules folder is `modules` or `Modules`?
2. Modules folder is located next to `app` folder or inside `app` folder? app/Config/Autoload.php if next lowercase: PHP Code: 'Modules\Core' => ROOTPATH . 'modules/Core', if next uppercase PHP Code: 'Modules\Core' => ROOTPATH . 'Modules/Core', if inside lowercase: PHP Code: 'Modules\Core' => APPPATH . 'modules/Core', PHP Code: 'Modules\Core' => APPPATH . 'Modules/Core', Views: PHP Code: return view('Modules\Core\Views\home'); |
Welcome Guest, Not a member yet? Register Sign In |