CodeIgniter Forums
Global Variable - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forum-1.html)
+--- Forum: Lounge (https://forum.codeigniter.com/forum-3.html)
+--- Thread: Global Variable (/thread-70217.html)



Global Variable - Prateek - 03-09-2018

Hi,

     Is there any way to create global variable in CI which can be accessed from any of the Model or Controller .(Note Variable is not Static)

         Thank you.
         Prateek Sinha


RE: Global Variable - jreklund - 03-09-2018

You can set and get a Config file.
https://www.codeigniter.com/user_guide/libraries/config.html


RE: Global Variable - emmawatson8855 - 04-03-2018

You can also find some informative information about global variable on StackOverflow https://stackoverflow.com/questions/17013397/code-igniter-best-place-to-declare-global-variable?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa