I\'m using a template engine that inserts code in my site where I want it.
I wrote a function to test for something which is quite easy:
myfunction()
You cannot use something like this :
$this->getData()['a']['b']
ie, array-access syntax is not possible directly on a function-call.
Youy have to use some temporary variable, like this :
$tmp = $this->getData();
$tmp['a']['b'] // use $tmp, now
In your case, this probably means using something like this :
function myfunction() {
$tmp = $this->getData();
return ($tmp['a']['b'] ? true : false);
}
You have to :
getData()
method, and store its return value in a temporary varibaleYou don't have much choice about that, actually...