![]() |
Hi All,
I am currently working on a project, where I am keeping all my code in a module. So my structure is as below: Code: -app Now everything else from Modules (Routes, Controllers, Views) is working fine as I have provided namespace in Autoload.php, but Helpers and Constants are not working as they are not classes. In app > Config > autoload.php, I tried to add files as well with correct path, but it is still not working. Code: public $files = [ I can make it work if I make them classes, but before I do that way, I want to check how to make it work without making classes. I read CI guide at https://codeigniter4.github.io/userguide...ml#helpers , where it is written that "Helpers will be automatically discovered within defined namespaces when using the Code: helper() But it is not working. I tried that way as well in the Controller. Code: helper('MyModule\Admin\Helpers\functions'); Any idea from anyone? |
Messages In This Thread |
Modules in CI4 - Helpers and Constants - by encodedigital - 09-14-2023, 08:58 AM
RE: Modules in CI4 - Helpers and Constants - by InsiteFX - 09-14-2023, 09:13 PM
RE: Modules in CI4 - Helpers and Constants - by datamweb - 09-14-2023, 11:59 PM
RE: Modules in CI4 - Helpers and Constants - by encodedigital - 09-16-2023, 10:10 AM
|