PHP code example of wearesho-team / yii2-header-language-selector

1. Go to this page and download the library: Download wearesho-team/yii2-header-language-selector library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wearesho-team / yii2-header-language-selector example snippets




// config/main.php

use Wearesho\Yii\HeaderLanguageSelector;

return [
    'id' => 'appId',
    'basePath' => __DIR__,
    'bootstrap' => [
        'headerLanguageSelector' => [
            'class' => HeaderLanguageSelector\Bootstrap::class,
            'defaultLanguage' => 'ru',
            'supportedLanguages' => ['ua', 'ru', 'en',],
            'headerAttribute' => 'language',
        ],
    ],
];