Static Constructs
Last updated
Was this helpful?
Was this helpful?
component MyFunkyCalculator{
// Static Constructor
static {
CACHE_KEY = "luis";
multiplier = 4;
}
public static function calculate( a ){
return static.multiplier * a;
};
public static function getGlobalCacheKey(){
return static.CACHE_KEY;
}
}// Refer to the CFC by path, then use the :: and call a function or variable
MyFunkyCalculator::CACHE_KEY;
MyFunkyCalculator::calculate( 1 );