CodeIgniter Forums
About structure - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10)
+--- Thread: About structure (/showthread.php?tid=75817)



About structure - Shoesmith - 03-19-2020

I'm building my first web app with Codeigniter, so please go easy.

As part of my application, I have a function in a PHP file that calls an API, parses the results, and inserts them into the app database. Right now, I have it stored outside the CI application folder. It doesn't really require an MVC structure. It's just a private function.

Where is the best place to store and run the file? Do I just keep it outside, or is there a structure convention for how to store private function files that need views or controllers?


RE: About structure - jreklund - 03-20-2020

Hi, and welcome to the forum.

I would place it in /application/library, and load it from there. So that your main folder don't get bloated in case you add more "third party" scripts.


RE: About structure - Shoesmith - 03-30-2020

Thanks for the guidance.