wearesho-team / yii2-header-language-selector
Library for configuring auto setting language from headers in yii2 application
1.0.0
2018-10-08 10:34 UTC
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: 2024-11-26 05:46:58 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', ], ], ];