common/components/SetLanguage.php
/*
     * check cookie set or not, if not set default language is Ebglish
     */
check cookie set or not, if not set default language is Ebglish
check cookie set or not if not set default language is Ebglish
public static function Language() {
        $cookies1 = Yii::$app->request->cookies;
        if ($cookies1->has('language')) {
            $language = $cookies1->getValue('language');
        } else {
            $language = 'en';
        }
        Yii::$app->session['language'] = $language;
        return $language;
    }
public static function Language ( ) { $ cookies1 = Yii :: $ app -> request -> cookies ; if ( $ cookies1 -> has ( 'language' ) ) { $ language = $ cookies1 -> getValue ( 'language' ) ; } else { $ language = 'en' ; } Yii :: $ app -> session [ 'language' ] = $ language ; return $ language ; }
check cookie set or not, if not set default language is Ebglish
check cookie set or not if not set default language is Ebglish