CodeIgniter Forums
Loading CI Framework without loading page itself - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Loading CI Framework without loading page itself (/showthread.php?tid=76010)



Loading CI Framework without loading page itself - AnkouTankou - 04-06-2020

Hi, I'm using CodeIgniter 3.1.x version, and my question would be :
Is it possible to load CI's framework and access to atleast a few models/controllers , without loading page itself?
Basically what I'm doing, is I'm trying to let another PHP application, that is completely OUTSIDE of CI's main folder, to access certain data (such as session).
Is there any real way to atleast try to dip into it without loading the page itself?
I've tried hacking inner core files, making custom third party library, including modified index files - everything I've tried lead to loading main website (including display, templates - everything), while I only need to access certain functions that are in CI.
I've tried this also, but this is way too outdated : https://github.com/bcit-ci/CodeIgniter/wiki/dip-into-CI


RE: Loading CI Framework without loading page itself - includebeer - 04-08-2020

Maybe you can keep the code as 2 separate applications and access the CI code via an API that return JSON data?


RE: Loading CI Framework without loading page itself - albertleao - 04-08-2020

If it's on the same machine, you can access it via the CLI