I am finding extreme difficulty in understanding "EVENTS" IN Yii.
I can not comprehend what is the role of instance of CEvent.
For example,Let us have two anonymous functions.
function greetOne($name) {echo "hello ".$name;}
function greetTwo($name) {echo "hello ".$name;}
Let us have an object inherited from CComponent,$component.
Let us assume we have an event,"onMeeting".
Now we will attach the two functions to the event.
$component->onMeeting="greetOne";
$component->onMeeting="greetTwo";
My question is how to declare the CEvent, so that we can pass parameters
to both the anonymous functions.For example I want to pass "Jack" to greetOne
and "Jill" to greetTwo as parameters.
The following is not working.
$component->raiseEvent('onMeeting',new CEvent($this,'Jack','Jill'));
More over I am not able to understand the purposes of "sender" and "params"
declared in CEvent.Where else they are called.
I am desperate in understanding the "events in Yii",as it is a key aspect of it.