firdows/yii2-menu

menu system

Installs: 229

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 3

Open Issues: 0

Type:yii2-extension

1.0 2016-08-10 16:46 UTC

This package is auto-updated.

Last update: 2024-04-23 15:56:00 UTC


README

ระบบจัดการเมนู ระบบนี้ผมพัฒนาใช้เองทั้งเว็บไซต์ ซึ่งเหมาะสำหรับงาน Backend อีกทั้งระบบยังผนวกเข้ากับ RBAC ช่วยในเรื่องการจัดการสิทธิ์การแสดงเมนู ระบบจะมีใจความสำคัญดังนี้

  • จัดการเมนู
  • จัดการสิทธิ์ให้กับเมนู (BRAC)
  • จัดการหมวดหมู่เมนู
  • จัดทำเมนูซ้อนกันได้

Installation ติดตั้ง

Install With Composer

The preferred way to install this extension is through composer.

Either run

composer require firdows/yii2-menu "@dev"

Or, you may add

"firdows/yii2-menu" : "@dev"

Required ความต้องการ

Update either config/web.php (basic) or config/main.php (advanced)

return [
    ...
    'modules' => [
        'menu' => [
            'class' => 'firdows\menu\Module',
        ],
    ],
    'components'=>[...]
    ...
];

Migrations

yii migrate --migrationPath=@firdows/menu/migrations

ตั้งค่า RBAC

Basic Configuration

yii migrate --migrationPath=@mdm/admin/migrations

Usage การเรียกใช้

การป้อนรหัสหมวดหมู่เมนูเข้าไปในฟังค์ชั่นจะได้ข้อมูล Array อ่าน

$nav = new firdows\menu\models\Navigate();
$menu = $nav->menu(menu_cate_id);

การนำไปใช้กับ Widget

Ex.

dmstr\widgets\Menu::widget([
    'options' => ['class' => 'sidebar-menu'],
    'items' => $menu,
]);

Example

687474703a2f2f696b686c6173736572766963652e636f6d2f75706c6f6164732f6d656e752e706e67

Develop By

Ahmad