Welcome Guest, Not a member yet? Register   Sign In
modules and language in codeigniter 4
#4

(This post was last modified: 07-17-2020, 12:24 PM by InsiteFX.)

Did you namespase the Modules and Admin in the Autoloader?

Example:

PHP Code:
    public $psr4 = [
        
APP_NAMESPACE               => APPPATH,                                 // For custom app namespace
        
'Config'                    => APPPATH  'Config',
        
'Myth\Auth'                 => ROOTPATH 'Myth/Auth',                  // Module Myth::Auth
        
'Insitefx'                  => ROOTPATH 'Insitefx',                   // Modules
        
'Insitefx\Blog'             => ROOTPATH 'Insitefx/Blog',              // Module Blog
    
]; 

If  you do not namespace them it will not be able to find them easily.
 
So in your case you would want to add these.

PHP Code:
'Modules'       => APPPATH.'Modules',
'Modules\Admin' => APPPATH.'Modules/Admin'

Then use a use clause to set the path to your language folder.

Something like this not tested.

PHP Code:
use App\Modules\Admin\Language\en

I use phpStorm Editor so it tells me what needs to be done.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: modules and language in codeigniter 4 - by InsiteFX - 07-17-2020, 12:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB