wearesho-team / yii2-header-language-selector
Library for configuring auto setting language from headers in yii2 application
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
pkg:composer/wearesho-team/yii2-header-language-selector
Requires
- php: >=7.2
- yiisoft/yii2: ^2.0.15.1
Requires (Dev)
- phpunit/phpunit: ^7.4
- squizlabs/php_codesniffer: ^3.3
This package is auto-updated.
Last update: 2025-09-26 07:53:25 UTC
README
This library allows you to configure setting language from http header in yii2 application.
Setup
composer require wearesho-team/yii2-header-language-selector
Configure
Append bootstrap declaration in your app config with next item
<?php // 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', ], ], ];