2017 © Pedro Peláez
 

yii2-extension languageswitcher

Yii Framework 2.0 Component language switcher

image

harlangray/languageswitcher

Yii Framework 2.0 Component language switcher

  • Friday, January 23, 2015
  • by harlangray
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

languageswitcher

Component for Yii2 language switcher, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist "harlangray/languageswitcher": "*"

or add, (*4)

"harlangray/languageswitcher": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply modify your application configuration as follows:, (*6)

return [
    'bootstrap' => ['lang'],
    'components' => [
        'lang' => [
            'class' => 'harlangray\language\Language',
            'queryParam' => 'lang',

        ],
        // ...
    ],
    ...
];

You must define available languages in Yii::$app->params['languages'] as code => language in the config/params.php, (*7)

'languages' => [ 'en' => 'english', 'si' => 'සිංහල', 'ta' => 'தமிழ்' ], (*8)

and use, (*9)

Yii::$app->lang->getMenuItems()

In your menu "items", (*10)

EX: echo Nav::widget([ 'options' => ['class' => 'navbar-nav navbar-right'], 'items' => [ ['label' => 'Home', 'url' => ['/site/index']], ........ ......... ........ Yii::$app->lang->getMenuItems() ],
]); NavBar::end();, (*11)

The Versions

23/01 2015

dev-master

9999999-dev

Yii Framework 2.0 Component language switcher

  Sources   Download

MIT

The Requires

 

by Harlan Gray

language yii2 switcher

22/01 2015

1.0.0

1.0.0.0

Yii Framework 2.0 Component language switcher

  Sources   Download

MIT

The Requires

 

by Harlan Gray

language yii2 switcher