maks757/yii2-multi-lang

There is no license information available for the latest version (3.0.2) of this package.

Yii2 url manager with supporting multi languages.

Installs: 47

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 2

Type:yii2-extension

3.0.2 2018-05-17 08:31 UTC

This package is not auto-updated.

Last update: 2024-11-19 17:24:15 UTC


README

INSTALLATION

You can use this migrate language table or yours ActiveRecord model.

yii migrate --migrationPath=@vendor/maks757/yii2-multi-lang/migration

If you use yours ActiveRecord model, please implements from ILanguage interface.

maks757\multilang\components\ILanguage

main.php configure UrlManager

'UrlManager' => [
	'class' => 'maks757\multilang\MultiLangUrlManager'
	...
]

add to ActiveRecord configure TranslationBehavior

    public function behaviors()
    {
        return [
            'translation' => [
                'class' => TranslationBehavior::className(),
                'translationClass' => ArticleTranslation::className(),
                'relationColumn' => 'article_id'
            ]
        ];
    }