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');
}