Hi Guys!
I found this useful part of code which works,
but I do not understand one part of it.
Okay, lets say you have following functions in your model:
public static function getMyItemList()
{
return [
0 => 'Zero',
1 => 'One',
2 => 'Two',
3 => 'Three',
4 => 'Four'
];
}
public function getMyItemLabel()
{
return self::getMyItemList()[$this->item]; // <---- this is what I do not understand.
}
The [$this->item] comes directly after the function call?
I’m used to for example getMyItemList($myParam) and return the selected item in getMyItemList.
But this "getMyItemList()[$this->item]" is new to me.
Could someone please explain it or can tell me how it is "called"?
Then I will find it myself I think.
Thank you and best regards