Accessing constants defined in models |
[eluser]srisa[/eluser]
Hello, If I define a constant in a model as const REL = 1;, how do I access that constant from outside the model? I just ran a test, I can access it as className::const. Assuming my model is define as class Options extends Model{ const REL = 1; } In the controller I am referring to that constant like this $this->load->model('options'); echo 'constant is '.Options::REL.'<br />'; Is that acceptable or is there a better way of doing this? Thank you.
[eluser]kirrie[/eluser]
http://www.php.net/manual/en/language.oo...stants.php
|
Welcome Guest, Not a member yet? Register Sign In |