CodeIgniter Forums
Programming Advice : Best way to pass global variables to ME Modules? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Programming Advice : Best way to pass global variables to ME Modules? (/thread-15592.html)



Programming Advice : Best way to pass global variables to ME Modules? - El Forum - 02-09-2009

[eluser]opel[/eluser]
I am using the Modular extensions system to break my application into modules with a front end and back end controller e.g.

Blog
--Controllers
----blog.php
----admin.php


My questions is what is the best way to pass global variables to all the controllers? I have set up a settings controller and also a settings library but I think it is overkill.

The settings will include the site information e.g. company name, details etc and mainly the modules I am using. I want to create a list of arrays in a central location that I can edit for future sites. This will be done by me or another developer so at the moment using a DB isn't required.

Any advice is appreciated.

Cheers


Programming Advice : Best way to pass global variables to ME Modules? - El Forum - 02-09-2009

[eluser]TheFuzzy0ne[/eluser]
This thread may or may not help you. http://ellislab.com/forums/viewthread/105142/


Programming Advice : Best way to pass global variables to ME Modules? - El Forum - 02-13-2009

[eluser]opel[/eluser]
I am using the SimpleTemplate library and after reading the manual found out I could use $this->template->set('variable', $variable);

But thanks for the link I'll have a read