Welcome Guest, Not a member yet? Register   Sign In
Myth-Auth in HMVC structure
#1

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
Reply
#2

(This post was last modified: 08-25-2021, 01:38 AM by InsiteFX.)

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

it is more convenient install using composer
Reply
#4

Shared hosting will not allow Composer etc;
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