shoxabbos/yii2-langselect

Langugae selector

Installs: 8

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Type:yii2-extension

v1.0 2017-08-17 08:47 UTC

This package is not auto-updated.

Last update: 2024-04-28 01:45:10 UTC


README

Langugae selector

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist shoxabbos/yii2-langselect "*"

or add

"shoxabbos/yii2-langselect": "*"

to the require section of your composer.json file.

Usage

Add this Bootstrap Class to your web/config.php file:

'bootstrap' => [
    [
        'class' => '\shoxabbos\langselect\LanguageSelector',
        'supportedLanguages' => ['en', 'ru'],
    ],
],

To change the language of the site, You need to call URL with a "lang" parameter:

http://localhost/site/index?lang=en
http://localhost/site/index?lang=ru