Language mangement for URL's
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist cyberz/yii2-language-url "*"
or add
"cyberz/yii2-language-url": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
1)Apply migartion:
php yii migrate/up --migrationPath=vendor/cyberz/yii2-language-url/language/migrations
2)Setup config:
'components' => [
'request' => [
'class' => 'cyberz\language\components\LanguageRequest'
...
'urlManager' => [
'class'=>'cyberz\language\components\LanguageUrlManager',
...
3)Use widget:
<?= \cyberz\language\widgets\Switcher::widget(); ?>