I have a CApplicationComponent extension which I am trying to use CApcCache on by calling:
However it is giving this error:
CApcCache and its behaviors do not have a method or closure named "addValue".
Do I have to specifically include CApcCache for the component?
The best way is to include CApcCache instance in the extension as it is possible that Yii::app()->cache is not of CApcCache type.
In my main config file I have the line:
and when calling cache the error states CApcCache…could the cache type still not be CApcCache?
Any got any idea about this one? - I dont want to include the cache function if it already being loaded somewhere else.
I have now included the CApcCache within my extension and instantiated it using
// Init cache
$this->cache = new CApcCache;
However still getting the error:
CApcCache and its behaviors do not have a method or closure named "addValue"
I am really stuck with this one and need some help - has anyone got any suggestions?
cheers, those all seem fair points. Have now got it working using:
So should be independant to cache type.
You dont need all this
inside the component just use