Define/include "globally available" arrays and functions |
06-06-2021, 09:00 AM
(This post was last modified: 06-06-2021, 09:16 AM by tomsenner. Edit Reason: php markup ) (06-06-2021, 05:54 AM)paulbalandan Wrote: You can place the file anywhere you want as it is not specifically a helper. Helpers' file names should end in `_helper`, like `number_helper.php` for the `helper()` function to work. Since your file is not a helper per se, anywhere is fine as long as you include the full path to the `$files` property. I created the file "app/own_functions.php" and added the line PHP Code: public $files = [ 'app/own_functions.php', ]; in "app/Config/Autoload.php". But the view that is using the function only outputs the error "Call to undefined function". I tried to change the path inside public $files in various ways (e.g without "app/" only 'own_functions.php'). Still only errors. What's my mistake? |
Welcome Guest, Not a member yet? Register Sign In |