ayaalkaplin/yii2-multilang

Multilang for Yii2

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Type:yii2-extension

v0.0.5 2019-03-12 01:59 UTC

This package is auto-updated.

Last update: 2024-05-12 13:16:57 UTC


README

Multilang for Yii2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist ayaalkaplin/yii2-multilang "*"

or add

"ayaalkaplin/yii2-multilang": "*"

to the require section of your composer.json file.

Usage

Be sure that you have lines in urlManager config:

'urlManager' => [
    ******
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    ******
]

Migrate:

php yii migrate --migrationPath=@vendor/ayaalkaplin/yii2-multilang/src/migrations

Once the extension is installed, simply use it in your code by :

<?= \ayaalkaplin\multilang\widgets\lang\Change::widget(); ?>

For backend add this URL

<?= Url::toRoute(['/multilang/back-lang/index']); ?>