Multi-language Extension for Yii 2
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'
]
];
}