Components/MultilangRequest.php
public function resolve() {
        $resolve = parent::resolve();
        $languages = Language::getDb()->cache(function ($db) {
            return Language::find()->where(['is_active' => true])->asArray()->all();
        });
        Yii::$app->params['languages'] = ArrayHelper::map($languages, 'code', 'code');
        Yii::$app->language = $this->getCurrentLang();
        return $resolve;
    }
public function resolve() {
        $resolve = parent::resolve();
        $languages = Language::getDb()->cache(function ($db) {
            return Language::find()->where(['is_active' => true])->asArray()->all();
        });
        Yii::$app->params['languages'] = ArrayHelper::map($languages, 'code', 'code');
        Yii::$app->language = $this->getCurrentLang();
        return $resolve;
    }
public function resolve ( ) { $ resolve = parent :: resolve ( ) ; $ languages = Language :: getDb ( ) -> cache ( function ( $ db ) { return Language :: find ( ) -> where ( [ 'is_active' => true ] ) -> asArray ( ) -> all ( ) ; } ) ; Yii :: $ app -> params [ 'languages' ] = ArrayHelper :: map ( $ languages , 'code' , 'code' ) ; Yii :: $ app -> language = $ this -> getCurrentLang ( ) ; return $ resolve ; }
Resolve
Resolves the current request into a route and the associated parameters.
Sets default application language
@return array the first element is the route, and the second is the associated parameters.
@throws \yii\web\NotFoundHttpException if the request cannot be resolved.
Resolve Resolves the current request into a route and the associated parameters . Sets default application language