Menu
I have a class [I]myclass
I would like for this class to have constants that are defined that could be accessed like: myclass->CONSTANT1
I would like the class constructor to define this constants, as it will be the constructor generating the values. Such as (pseudo):
[code=php] class testclass {
FUNCTION testclass()
{
define(‘CONSTANT1’, 1);
}
}
$myclass = new testclass();
echo ‘–>’. $myclass->CONSTANT1; //THIS VALUE IS NOT PRINTING!
How can I get this to work?