nullref/yii2-full-admin

安装: 476

依赖: 1

建议者: 0

安全: 0

星标: 3

关注者: 5

分支: 1

开放问题: 0

类型:yii2-extension

dev-master 2020-04-07 12:49 UTC

This package is auto-updated.

Last update: 2024-09-07 21:46:26 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

具有用户管理的管理模块

安装

安装此扩展的首选方式是通过 Composer

运行以下命令之一

php composer.phar require --prefer-dist nullref/yii2-full-admin "*"

或者

"nullref/yii2-full-admin": "*"

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

然后运行控制台命令安装此模块并运行迁移

php yii module/install nullref/yii2-full-admin

此外,您需要将 \nullref\fulladmin\Bootstrap 类添加到 bootstrap

//config
    'bootstrap' => [
        //..
        \nullref\fulladmin\Bootstrap::class,
        //...
    ],

请注意,如果您不使用我们的 应用模板,则需要更改配置文件结构以运行上述命令。

请查看此 文档部分

管理菜单

要向管理菜单中添加项目,您需要实现 IAdminModule 接口,例如。

public static function getAdminMenu()
   {
       return [
           'label' => \Yii::t('admin', 'Subscription'),
           'icon' => 'envelope',
           'order' => 0,
           'items' => [
               'emails' => ['label' => \Yii::t('app', 'Subscribers'), 'icon' => 'envelope-o', 'url' => ['/subscription/email/index']],
               'messages' => ['label' => \Yii::t('app', 'Messages'), 'icon' => 'envelope-o', 'url' => ['/subscription/message/index']],
           ]
       ];
   }

管理控制器

如果您在控制器中使用 IAdminController 接口,则在操作之前将在控制器中设置管理布局和默认访问规则。

模块系统

此模块集成到包含其他有用组件的系统。 查看详情

覆盖

示例

/** module config **/

'admin' => [
   'class' => 'nullref\admin\Module',
   'controllerMap' => [  //controllers
      'main' => 'app\modules\admin\controllers\MainController',
   ],
   'components' => [  //menu builder
      'menuBuilder' => 'app\\components\\MenuBuilder',
   ],
],

以及 翻译