maks757 / yii2-multi-lang

Yii framework multi language extention

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multi-language Extension for Yii 2

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'
            ]
        ];
    }

About

Yii framework multi language extention

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%