CodeIgniter Forums
Myth-Auth in HMVC structure - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- 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:
Myth\Auth\Authentication;
to
Addon\Auth\Authentication;

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:
ci/addon/auth
ci/app
ci/system

================
Thanks


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
system
app
public
Myth
-- 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;