Download the PHP package daxslab/yii2-poligloturl without Composer
On this page you can find all versions of the php package daxslab/yii2-poligloturl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package yii2-poligloturl
PoliglotUrl
Extension to help setup the language of an application based on params specifing the language
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Configuration
Configure the View component into the main configuration file of your application:
'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:
<?= Html::a('Spanish version', ['/site/index', 'lang' => 'es']) ?>
All versions of yii2-poligloturl with dependencies
PHP Build Version
Package Version
Requires
yiisoft/yii2 Version
*
The package daxslab/yii2-poligloturl contains the following files
Loading the files please wait ....