public function __construct(\CApplication $yii = null) { if (is_null($yii)) { $yii = \Yii::app(); } $this->yii = $yii; }