CodeIgniter Forums
Problem accessing constants from controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Problem accessing constants from controller (/showthread.php?tid=13919)



Problem accessing constants from controller - El Forum - 12-11-2008

[eluser]manuelpibe[/eluser]
Hey guys,
how do you access constants defined in constants.php from a controller?


Problem accessing constants from controller - El Forum - 12-11-2008

[eluser]jalalski[/eluser]
As you would any other constant.

echo FOPEN_READ;

will echo 'rb'


Problem accessing constants from controller - El Forum - 12-11-2008

[eluser]manuelpibe[/eluser]
Thanks Summer Student, that worked. My problem was that I was putting a $ in front of the constant.