Codeigniter 4.0.4 HMVC Converted (Ready to use) PHP 7.2 or above
- Clone the repository
- Run -> php spark serve / use local Xampp/Mamp/Wamp environment to run the app
- To access hmvc module use the following Path to Host/Folder/public/welcome Example: http://localhost:8888/Codeigniter-4-HMVC/public/welcome
- App
- Modules
- Welcome
- Controllers
- Models
- Views
- Config -Routes.php (to set routes for this module)
- Welcome
- Modules
(Don't make these changes in this repository code, it already have these changes)
- Add Modules folder under App (App/Modules) and put MVC in it. For reference copy from App/Modules
- Copy below code in App/Config/Routes.php
/**
* --------------------------------------------------------------------
* HMVC Routing
* --------------------------------------------------------------------
*/
foreach(glob(APPPATH . 'Modules/*', GLOB_ONLYDIR) as $item_dir)
{
if (file_exists($item_dir . '/Config/Routes.php'))
{
require_once($item_dir . '/Config/Routes.php');
}
}- Set Routes in App/Modules/Welcome/Config/Routes.php
contact [at] ibrinfotech.com