well i have a configuration like this in the components
part of my config file
'components'=>array(
'messages' => array(
'onMissingTranslation' => array('MissingTranslation','handler'),
),
);
now this is my MissingTranslation
class
class MissingTranslation extends CApplicationComponent{
public function handler($event){
$msg= $event->message;
}
}
now I tested it by using Yii:t("hello");
where in the "hello" doesn't have any translation at all. and this creates an error
call_user_func() expects parameter 1 to be a valid callback, non-static method MissingTranslation::handler() should not be called statically
I remove the onMissingTranslation
event handler and it works fine so I'm suspecting that the event handler has the problem.
Is this a bug already of Yii? or I did something bad again?
UPDATE
this is the answer from Yii
https://github.com/yiisoft/yii/issues/902#issuecomment-6732258
I hope this will help to someone will encounter the same issue