Welcome Guest, Not a member yet? Register   Sign In
Modules constants
#1

Hey all, I am experimenting with codeigniter 4.

I am intending to recreate an old project I did with CI 3. But in the process of my analysis I decided to split of all major components in seperate modules.

Now as I am lazy and don't want to write specific namespace everytime. I was thinking of placing it inside the constants.php config file in every module. But I can not get it to work. Am I missing something?

defined('MODULE_NAMESPACE') || define('MODULE_NAMESPACE', 'Admin');
defined('MODULE_NAMESPACE_LOC') || define('MODULE_NAMESPACE_LOC', 'Modules\Admin\\');

public function index()
{
     return view(MODULE_NAMESPACE_LOC .'Views\admin');
}
Reply


Messages In This Thread
Modules constants - by ZoeF - 03-07-2021, 07:23 PM
RE: Modules constants - by ZoeF - 03-08-2021, 11:57 AM
RE: Modules constants - by tgix - 03-09-2021, 01:35 AM
RE: Modules constants - by ZoeF - 03-09-2021, 06:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB