TranslateModule::translator PHP Метод

translator() статический публичный Метод

get the translate component
static public translator ( ) : MPTranslate
Результат MPTranslate
    static function translator()
    {
        $component = Yii::app()->getComponent(self::$translateComponentId);
        if ($component === null) {
            throw new CException('Translate component must be defined');
        }
        return $component;
    }

Usage Example

 /**
  * 
  */
 public function actionMissing()
 {
     $model = new MessageSource('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['MessageSource'])) {
         $model->attributes = $_GET['MessageSource'];
     }
     $model->language = TranslateModule::translator()->getLanguage();
     $this->render('missing', array('model' => $model));
 }
All Usage Examples Of TranslateModule::translator