2017 © Pedro PelĂĄez
 

yii2-extension yii2-poligloturl

Extension to help setup the language of an application based on params specifing the language

image

daxslab/yii2-poligloturl

Extension to help setup the language of an application based on params specifing the language

  • Sunday, January 28, 2018
  • by glpzzz
  • Repository
  • 2 Watchers
  • 0 Stars
  • 158 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PoliglotUrl

Extension to help setup the language of an application based on params specifing the language, (*1)

Installation

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

Either run, (*3)

php composer.phar require --prefer-dist daxslab/yii2-poligloturl "*"

or add, (*4)

"daxslab/yii2-poligloturl": "*"

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

Configuration

Configure the View component into the main configuration file of your application:, (*6)

'components' => [
    ...
    'urlManager' => [
        'class' => 'daxslab\poligloturl\UrlManager',
        'enablePrettyUrl' => true,
        'showScriptName' => false,
        'rules' => [
            //home
            ['pattern' => '/', 'route' => 'site/index', 'defaults' => ['lang' => 'en-US']],
            ['pattern' => '/es', 'route' => 'site/index', 'defaults' => ['lang' => 'es']],
            ['pattern' => '/de', 'route' => 'site/index', 'defaults' => ['lang' => 'de']],
        ],
    ],
    ...
]

Usage

Once the extension is configured, simply use it in your views by:, (*7)

<?= Html::a('Spanish version', ['/site/index', 'lang' => 'es']) ?>

The Versions

28/01 2018

dev-master

9999999-dev

Extension to help setup the language of an application based on params specifing the language

  Sources   Download

MIT

The Requires

 

by Gabriel A. LĂłpez LĂłpez

url yii2 i18n seo

09/01 2018

1.0.0

1.0.0.0

Extension to help setup the language of an application based on params specifing the language

  Sources   Download

MIT

The Requires

 

by Gabriel A. LĂłpez LĂłpez

url yii2 i18n seo