Welcome Guest, Not a member yet? Register   Sign In
Where to declare an application-wide variable?
#1

[eluser]behdesign[/eluser]
I want to declare a variable that will be used throughout the application (namely, a $SITE_ID variable that gets pulled from the db from the base_url). Where is the best place to do that in the cascade? Thanks!
#2

[eluser]Cro_Crx[/eluser]
Any constants that aren't going to be modified can be specified in constants.php. If you wish to store config variables in a database, you can read them in using the config class http://ellislab.com/codeigniter/user-gui...onfig.html
#3

[eluser]pdxbenjamin[/eluser]
Check out my previous thread.
http://ellislab.com/forums/viewthread/142718/
#4

[eluser]jedd[/eluser]
[quote author="behdesign" date="1266143814"]
... a $SITE_ID variable that gets pulled from the db from the base_url ...
[/quote]

Where does it get pulled from?




Theme © iAndrew 2016 - Forum software by © MyBB