CodeIgniter Forums
Confusion in documentation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Confusion in documentation (/showthread.php?tid=77506)



Confusion in documentation - kelvinwongg - 09-09-2020

I go thru the documentation of CI4, and am confused in section:

General Topics > Helper Functions > Loading from Non-standard Locations
codeigniter.com/user_guide/general/helpers.html#loading-from-non-standard-locations

There the namespace of the Blog module is 'Example\Blog', but later referred as 'Modules\Blog' when calling helper function, like so:

PHP Code:
helper('Modules\Blog\blog'); 

I finally figured out that the "correct" way to call the helper is helper('Example\Blog\blog'); OR register the namespace in the autoload config files as: 'Example\\Blog' => ROOTPATH . 'Modules/Blog',

It would be a problem to CI4 and PSR-4 PHP namespace newbie. If I am getting it right, we should correct it?