• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
modules and language in codeigniter 4

#4
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.