Hi
I am reading a good article about yii events by Steven O’Brien at http://phpmaster.com/yii-under-the-hood-2/#comment-25931 .
But as given in this example I am not able to understand the use of class CList. e.g
in the __set() function we have following lines :
[i]if (!isset($this->_e[$name])) {
$this->_e[$name] = new CList();
}[/i]
return $this->_e[$name]->add($value);
So the property _e[$name] is storing the instance of class CList. But bellow this you have explained that _e is array like :
[i]$_e => array(
‘onUserRegistered’ => array(
0 => array(object, ‘sendMyEmail’)
),
‘onSomeOtherEvent’=>array(
0 => function(){}
1 => …
)
)[/i]
I am just confused to see that how _e is an array? it should be an object of class CList.
Thanks