Welcome Guest, Not a member yet? Register   Sign In
HMVC mechanism
#1

(This post was last modified: 10-21-2021, 04:21 AM by Milina.)

While surfing on internet I found a lot of ways for HMVC mechanism. But I can't find an easy way to perform the operation . As the documentation goes It should be autoloaded. But I have to write another program in app/Routes.php for loading everything.
Is there an easy way to perform this operation?
omegle
Thanks
Reply
#2

(This post was last modified: 10-14-2021, 01:11 AM by InsiteFX.)

Example Module Setup:

root
app
system
public

your_namespace (Blog Example)
-- Blog (module_name)
---- Config
------ Routes.php
---- Controllers
---- Database
---- Entities
---- Filters
---- Helpers
---- Language
---- Libraries
---- Models
---- Validation
---- Views


PHP Code:
// Autoloading.

// ./app/Config/Autoload.php

public $psr4 = [
    APP_NAMESPACE    => APPPATH,                      // For custom app namespace
    'Config'        => APPPATH 'Config',          // Config namespace
    'namespace\Blog' => ROOTPATH 'namespace/Blog',  // Blog namespace
]; 

Try that.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB