There MUST be SOME way to have global functions
Permalink
I have a few utility functions that I need for both controllers and views... but I can not find where I can put these in C5 to have them accessible globally.
So, i though ok, I will build a helper... I create a UtilsServideProvider, in the applicatio/src, but this is ignore as I i guess there is no such thing as Application/Core, just Concrete/Core?
I ended up making myself a vendor, adding my utils there, autoloading it (which I don't likle as this requires I mess with the core files)... and that works... but surely there must be a better way, no?
So, i though ok, I will build a helper... I create a UtilsServideProvider, in the applicatio/src, but this is ignore as I i guess there is no such thing as Application/Core, just Concrete/Core?
I ended up making myself a vendor, adding my utils there, autoloading it (which I don't likle as this requires I mess with the core files)... and that works... but surely there must be a better way, no?
Anything you put in "application/src" can be autoloaded in the "\Application\Src" namespace. You can also make a package for your custom code in the packages/ directory and set up an autoloader in on_start() for that package (or just autoload your code from Concrete\Package\YourPackage\Src)
thanks for the help.
I ended up creating a vendor for myself under packages/vendor (as I need it to be in the deliverable package).
I ended up creating a vendor for myself under packages/vendor (as I need it to be in the deliverable package).