wdmg/yii2-admin

Butterfly.CMS 的管理仪表板

安装: 588

依赖项: 1

建议者: 0

安全: 0

星标: 3

关注者: 4

分支: 1

开放问题: 12

语言:CSS

类型:yii2-extension


README

Yii2 Downloads Packagist Version Progress GitHub license

Administrative panel for Butterfly.CMS

Yii2 Admin 模块

Butterfly.CMS 的管理面板。

此模块是 Butterfly.СMS 内容管理系统的一个组成部分,但也可以作为一个独立的扩展使用。

版权所有 (c) 2019-2023 W.D.M.Group, Ukraine

要求

  • PHP 5.6 或更高版本
  • Yii2 v.2.0.40 及以上
  • Yii2 Base 模块(必需)
  • Yii2 Users 模块(必需)

安装

要安装该模块,请在控制台运行以下命令

$ composer require "wdmg/yii2-admin"

配置数据库连接后,请在控制台运行以下命令

$ php yii admin/init

然后选择要执行的操作

  1. 应用所有模块迁移
  2. 撤销所有模块迁移

迁移

在任何情况下,您都可以在控制台中运行以下命令以执行迁移和创建初始数据

$ php yii migrate --migrationPath=@vendor/wdmg/yii2-admin/migrations

配置

要将模块添加到项目中,请在配置文件中添加以下数据

'modules' => [
    ...
    'admin' => [
        'class' => 'wdmg\admin\Module',
        'routePrefix' => 'admin',
        'checkForUpdates' => true, // boolean, the flag if updates check turn on
        'cacheExpire' => 3600, // integer, the time to expire cache
        'multiSignIn' => false, // not allow by default
        'sessionTimeout' => 900, // 15 min.
        'customLocales' => [ // expanding the list of language locales for searching translations
            'uk-UA' => 'Українська',
        ],
        'customSupportModules' => [ // expanding the list of modules available for installation and download
            'wdmg/yii2-example',
        ],
        'customSidebarMenu' => [ // extending the sidebar menu list
            [
                'label' => 'Example',
                'icon' => 'fa fa-fw fa-bars',
                'url' => ['/admin/example/default'],
                'order' => 10,
            ]
        ],
        'customCreateMenu' => [ // expanding the creation menu list
            'wdmg/yii2-example' => [
                'label' => 'Add new example',
                'url' => ['/admin/example/default/create']
            ]
        ],
        'useSphinxSearch' => true, // boolean, the flag for configuration Sphinx Search
        'sphinxSearchConf' => [ // configuration of Sphinx Search daemon
            'dsn' => "mysql",
            'host' => "127.0.0.1",
            'port' => "9306",
            'username' => "",
            'password' => "",
        ]
    ],
    ...
],

路由

使用模块的 Module::dashboardNavItems() 方法生成 NavBar 的导航项列表,如下所示

<?php
    echo Nav::widget([
    'options' => ['class' => 'navbar-nav navbar-right'],
        'label' => 'Modules',
        'items' => [
            Yii::$app->getModule('admin')->dashboardNavItems(),
            ...
        ]
    ]);
?>

状态和版本 [准备使用]

  • v.1.4.6 - 修复侧边栏,终端链接
  • v.1.4.5 - 侧边栏菜单中的计数器已修复
  • v.1.4.4 - 添加任务和工单计数器