CodeIgniter Forums
Myth-Auth in HMVC structure - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: Libraries & Helpers (
+--- Thread: Myth-Auth in HMVC structure (/showthread.php?tid=79958)

Myth-Auth in HMVC structure - takbitdev - 08-24-2021

Hello everyone

I'm new to CI4 but I am experienced in CI3. Now I want to use Myth-auth in HMVC pattern in CI4 as a module named "Addon/auth".
For some reason I selected manual installation.

After install, should I change all namespace paths in all php files or is there a better approach?
For example:

I think by selecting this way, I will lose all updates. Also I installed Myth with composer on my localhost, but it is installed in a third party folder and I do not want this structure.

I want this structure with future updates capability:


RE: Myth-Auth in HMVC structure - InsiteFX - 08-25-2021

I just place Myth/Auth in the root along with the system and app folders, works like a charm.

root folder
-- Auth
-- I copy all the src files into Auth.

I then set the autoload namespace to this.

PHP Code:
public $psr4 = [
        APP_NAMESPACE => APPPATH// For custom app namespace
        'Config'      => APPPATH 'Config',
        'Myth\Auth'  => ROOTPATH 'Myth/Auth',                  // Myth/Auth namespace

Thats how I do it, there is a tutorial on here some place that shows how to do it step by step.

RE: Myth-Auth in HMVC structure - ikesela - 08-25-2021

it is more convenient install using composer

RE: Myth-Auth in HMVC structure - InsiteFX - 08-26-2021

Shared hosting will not allow Composer etc;