mediabet-concepture/yii2-blog-module

正在开发中的包

安装: 9

依赖者: 0

建议者: 0

安全: 0

类型:yii2-extension

v1.0.0 2019-12-15 15:36 UTC

This package is auto-updated.

Last update: 2024-09-22 12:58:11 UTC


README

连接

"require": {

"concepture/yii2-blog" : "*" 

},

php yii migrate/up --migrationPath=@concepture/yii2blog/console/migrations

连接后台模块

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

如果要重写控制器,请添加到模块配置中

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

        

如果要重写表示的文件夹,请添加到模块配置中

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

要重写任何类,可以使用 config.php 中的依赖注入。例如,将 StaticBlock 模型替换为您的模型。

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