humandevice / yii2-header-language-selector
此包已被废弃且不再维护。没有建议的替代包。
使用头部属性设置应用程序语言的Bootstrap类。
1.0
2017-03-10 06:50 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2022-02-01 13:06:05 UTC
README
使用头部属性设置应用程序语言的Bootstrap类。
安装
安装此扩展的首选方式是通过composer。
运行以下命令之一:
php composer.phar require --prefer-dist humandevice/yii2-header-language-selector "*"
或者将以下内容添加到你的composer.json
文件的require部分。
"humandevice/yii2-header-language-selector": "*"
使用方法
扩展安装完成后,只需在REST API配置中简单使用即可。
return [
// ...
'bootstrap' => [
// ...
'languageSelector' => [
'class' => 'hd\yii2\bootstrap\LanguageSelector',
'supportedLanguages' => ['en', 'pl'],
'defaultLanguage' => 'pl'
],
],
];