it-yakutia/yii2-collective

yii2 集成

安装: 64

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:yii2-extension

v1.0.3 2022-10-06 19:40 UTC

This package is auto-updated.

Last update: 2024-09-07 00:07:14 UTC


README

yii2 集成服务器

安装

安装此扩展的首选方法是通过 composer

运行以下命令之一:

php composer.phar require --prefer-dist it-yakutia/yii2-collective "*"

"it-yakutia/yii2-collective": "*"

将以下内容添加到您的 composer.json 文件的 require 部分中。

在控制台配置文件中添加迁移路径

'controllerMap' => [
    ...
    'migration' => [
        ...
        'migrationPath' => [
            ...
            '@vendor/it-yakutia/collective/src/migrations',
            ...
        ],
    ]
]

使用方法

扩展安装后,只需在代码中通过以下方式使用它:

<?= Url::toRoute(['/collective/back/index']); ?>

添加 RBAC 角色

collective

自定义视图文件

'custom_view_for_modules' => [
    'collective_front' => [
        'index' => '@frontend/views/front_page/index',
        '_item' => '@frontend/views/front_page/_item',
        'view' => '@frontend/views/front_page/view',
    ],
],
<?= Url::toRoute(['/collective/front/index']); ?>