Пример #1
0
 public function getTitle()
 {
     if ($this->id) {
         $model = RubricTranslate::find()->where(['rubric_id' => $this->id, 'language' => Yii::$app->language])->one();
     }
     return $model !== null ? $model->title : '';
 }
Пример #2
0
 private function prepareDetailViewAttributes($id)
 {
     $translate = RubricTranslate::find()->where(['rubric_id' => $id])->all();
     $attributes = [];
     foreach ($translate as $val) {
         $attributes[] = ['label' => Yii::$app->params['languages'][$val->language], 'attribute' => 'name', 'format' => 'raw', 'value' => $val->title];
     }
     return $attributes;
 }