Constants Help |
[eluser]CI_Newb[/eluser]
I've been trying to figure out how to use the constants.php file to load simple global variables that i need access to application wide but I can't figure out how to use it. I tried adding to constants.php Code: $test_var = "HOPE YOU CAN SEE THIS!"; and tried using it on a view page Code: <?php echo $test_var; ?> But all I got was a undefined variable error. Can someone point me in the right direction?
[eluser]WanWizard[/eluser]
That is not a constant, that's a normal variable. If you want to make it a constant: Code: define('TEST_VAR', 'HOPE YOU CAN SEE THIS!');
[eluser]CI_Newb[/eluser]
is there a different way to call TEST_VAR? I tried echo'ing it and it didn't work.
[eluser]danmontgomery[/eluser]
http://php.net/manual/en/language.constants.php |
Welcome Guest, Not a member yet? Register Sign In |