concepture/yii2-locale-based-article-module

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

package under development

dev-master / 1.0.0.x-dev 2020-02-15 15:21 UTC

This package is auto-updated.

Last update: 2021-09-15 18:58:42 UTC


README

Подключение

"require": { "concepture/yii2-article" : "*" },

Миграции php yii migrate/up --migrationPath=@concepture/yii2article/console/migrations

Подключение модуля для админки

 'modules' => [
     'article' => [
         'class' => 'concepture\yii2article\Module'
     ],
 ],

Для переопределния контроллера добавялем в настройки модуля

 'modules' => [
     'article' => [
        'class' => 'concepture\yii2article\Module',
        'controllerMap' => [
            'post' => 'backend\controllers\PostController'
        ],
     ],
 ],

Для переопределния папки с представленяими добавялем в настройки модуля

 'modules' => [
     'article' => [
         'class' => 'concepture\yii2article\Module',
         'viewPath' => '@backend/views'
     ],
 ],

Для переопределния любого класса можно вооспользоваться инекцией зависимостей через config.php К примеру подменить модель StaticBlock на свой

<?php
return [
    'container' => [
        'definitions' => [
            'concepture\yii2article\models\StaticBlock' => ['class' => 'backend\models\StaticBlock'],
        ],
    ],
]