Best way to share files among different CI projects, i.e. helpers, libraries - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: Best way to share files among different CI projects, i.e. helpers, libraries (/showthread.php?tid=75143) |
Best way to share files among different CI projects, i.e. helpers, libraries - deltatangodt - 12-29-2019 I have 3 projects that will each be using a REST API library I customized based on the CI Rest API Library project. It has it's own helpers, models and Libraries. I don't want to have the files spread out in the app folder, some in the helpers directory, the libraries directory, etc. So I created a folder in third_party and used the same structure as the app folder: libraries models helpers etc., with my custom code. If I want to load them however, I am not sure how I would go about doing that. Would I just have to do the usual "require_once" approach in the construct of the controller which will require them? Or is there a way to load->helper, for example, and specify the third_party directory? I am not sure if codeigniter will automatically find them. RE: Best way to share files among different CI projects, i.e. helpers, libraries - snelledre - 12-30-2019 (12-29-2019, 07:27 PM)deltatangodt Wrote: I have 3 projects that will each be using a REST API library I customized based on the CI Rest API Library project. It has it's own helpers, models and Libraries. I don't want to have the files spread out in the app folder, some in the helpers directory, the libraries directory, etc. Hello, For Codeigniter 3 you can use hmvc see here for information. For Codeigniter 4 you can use "namespacing see here for information. In both ways you can build also a version V1 and V2 off your API ect. I think it can help you. Andre RE: Best way to share files among different CI projects, i.e. helpers, libraries - abrkof - 12-30-2019 I have a project that is full functional in http://real.abrkof.com that work exactly how you require |