valearkot/yii2-module

Test module

Installs: 51

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Type:yii2-extension

3.3 2019-08-29 12:52 UTC

This package is auto-updated.

Last update: 2024-04-12 21:20:37 UTC


README

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist valearkot/yii2-module "*"

or add

"valearkot/yii2-module": "*"

to the require section of your composer.json file.

  • Migrate to create the desired table in the database (console):
yii migrate --migrationPath=@valearkot/yii2module/migrations --interactive=0
  • Migrate i18n datebase:
./yii migrate --migrationPath='@yii/i18n/migrations'
  • In config.php :
<?php 
$config = [
    'id' => 'basic',
    'language' => 'en',
    'sourceLanguage' => 'en',

And then add this to your application configuration:

<?php
return [

    // ...

    'components' => [
        // ...

        // Override the urlManager component
        'urlManager' => [
            'class' => 'codemix\localeurls\UrlManager',

            // List all supported languages here
            // Make sure, you include your app's default language.
            'languages' => $params['language'],
        ]

        // ...
    ]
];

Add in params.php:

<?php
return [


    'language' =>
            [
                'ru',
                'de',
                'en'
                //For example
            ],
];