protected function getLanguages() { $languages = DctLanguage::find()->select(['dct_language_id as id', 'name', 'locale'])->asArray()->all(); foreach ($languages as $lang) { $langList[$lang['id']] = $lang['name']; } return $languages; }
/** * Lists all DctLanguage models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => DctLanguage::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }
public function run() { return $this->render('lang/view', ['current' => DctLanguage::getCurrent(), 'langs' => DctLanguage::find()->where(['enable' => 1])->all()]); }
static function getLangByUrl($url = null) { if ($url === null) { return null; } else { $language = DctLanguage::find()->where('url = :url', [':url' => $url])->one(); if ($language === null) { return null; } else { return $language; } } }