Hi all,
I have worked with CodeIgniter for quite some time, and we always place any non standard helper files in the system/application/helpers directory. These are untouched when we upgrade the CI version and everything works out great.
Getting deeper into EE 2.0, my question is, where should we be putting helpers that we have currently developed for CI that we want to port to EE 2.0? My first guess would be a helpers folder within the third_party folder that way it’s untouched with version updates as well, but I am not sure if there is a means for this currently. Should we put them in expressionengine/helpers ? These files could “potentially” be overwritten on version upgrades etc.
Best practices for this?
Thanks!
webdezzo,
Like the third_party directory in CodeIgniter, the idea behind the system/expressionengine/third_party directory in EE is to house the total package. So you can have a config/helpers/libraries/models/etc directories that will work alongside your addons. When you are in your addon, you load them with $this->EE->load->library/helper/etc.
The idea behind this is that an update to EE will basically mean keeping your config and third_party directories and updating the rest of the app.
Make sense?
hi Greg, does putting library files in third_party/libraries load files that are in the autoload.php config file as well?
Just to clear up, you’re saying usint $this->EE->load->library(‘my_file’) loads third_party/libraries/my_file.php?
I’m asking because I can’t seem to get it to work. the only way I can get my custom library to load is if I place it in the libraries folder. :(
thanks,
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.