2017 © Pedro Peláez
 

yii2-extension yii2-ant-menu

一个为ant design 设计的菜单组件

image

toshcn/yii2-ant-menu

一个为ant design 设计的菜单组件

  • Friday, July 27, 2018
  • by toshcn
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

ant menu component

一个为ant design 设计的菜单组件, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist toshcn/yii2-ant-menu "*"

or add, (*4)

"toshcn/yii2-ant-menu": "*"

to the require section of your composer.json file., (*5)

Usage

配置应用组件:如common->config->main.php, (*6)

'components' => [
    'menuManager' => [
        'class' => 'toshcn\yii2\menu\MenuManager',
        'cache' = 'cache',
        'cacheKey' => 'menu_cache_key',
        'expire' => 3600,
        'userTable' => '{{%user}}',
        'superAdminGroupId' => 1
    ],
]

配置命令行: 基础模板在config->console.php,高级模板在console->config->main.php, (*7)

'controllerMap' => [
    'menu' => [
        'class' => 'toshcn\yii2\menu\commands\Menu',
    ],
],

运行数据迁移:, (*8)

php yii migrate --migrationPath=@vendor/toshcn/yii2-ant-menu/src/migrations

为用户表添加group_id字段, (*9)

php yii menu/add-user-group-id-column

添加一个用户组:, (*10)

Yii::$app->menuManager->addGroup('user', '用户组说明:普通用户组');

添加一个菜单:, (*11)

$parentId = 0;
Yii::$app->menuManager->addMenu('menu_name', 'path', $parentId, 'icon');

给用户组分配一个菜单:, (*12)

$menuId = 1;
$groupId = 1;
Yii::$app->menuManger->assignMenu($menuId, $groupId);

The Versions

27/07 2018

1.0.x-dev

1.0.9999999.9999999-dev

一个为ant design 设计的菜单组件

  Sources   Download

MIT

The Requires

 

by Avatar toshcn

extension yii2 menu

27/07 2018

dev-master

9999999-dev

一个为ant design 设计的菜单组件

  Sources   Download

MIT

The Requires

 

by Avatar toshcn

extension yii2 menu

27/07 2018

dev-dev

dev-dev

一个为ant design 设计的菜单组件

  Sources   Download

MIT

The Requires

 

by Avatar toshcn

extension yii2 menu