components
よく私は私の設定ファイルの一部にこのような設定を持っています
'components'=>array(
'messages' => array(
'onMissingTranslation' => array('MissingTranslation','handler'),
),
);
今、これは私のMissingTranslation
クラスです
class MissingTranslation extends CApplicationComponent{
public function handler($event){
$msg= $event->message;
}
}
今Yii:t("hello");
、「こんにちは」のどこに翻訳がないかを使用してテストしました。これによりエラーが発生します
call_user_func() は、パラメーター 1 が有効なコールバックであることを想定しています。非静的メソッド MissingTranslation::handler() を静的に呼び出すべきではありません
イベント ハンドラーを削除するonMissingTranslation
と正常に動作するので、イベント ハンドラーに問題があると思われます。
これはすでに Yii のバグですか? それとも私はまた何か悪いことをしましたか?
アップデート
これがYiiからの答えです
https://github.com/yiisoft/yii/issues/902#issuecomment-6732258
これが誰かが同じ問題に遭遇するのに役立つことを願っています