Welcome Guest, Not a member yet? Register   Sign In
Constant in a class
#1

[eluser]sl3dg3hamm3r[/eluser]
Hey there

I wonder how I could access a constant in a class/library from outside through CI's loading mechanics:

Code:
[...]
//library lib_test.php
const SOME_CONSTANT    = 0;

Now, in a controller, this doesn't work:
Code:
$this->load->library('lib_test'));
echo $this->lib_test::CONSTANT;    //Parse-error
echo $this->lib_test->CONSTANT;    //No parse-error, but neither a result

Any suggestion how to access constants (or class-vars)?

Sl3dg3


Messages In This Thread
Constant in a class - by El Forum - 01-31-2009, 06:29 AM
Constant in a class - by El Forum - 01-31-2009, 08:26 AM
Constant in a class - by El Forum - 01-31-2009, 09:13 AM
Constant in a class - by El Forum - 01-31-2009, 09:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB