cinghie/yii2-menu Yii2 Menu to create, manage, and delete dynamic menus in a Yii2 site.

yii2menùmenùyii2

Yii2 Menù

License Latest Stable Version Latest Release Date Latest Commit Total Downloads

Yii2 Menu to create, manage, and delete menù in a Yii2 site

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require cinghie/yii2-menu "*"

or add

"cinghie/yii2-menu": "*"

Configuration

1. Update yii2 menu database schema

Make sure that you have properly configured db application component and run the following command:

$ php yii migrate/up --migrationPath=@vendor/cinghie/yii2-menu/migrations

2. Install Yii2 Multilanguage

https://github.com/cinghie/yii2-multilanguage

3. Set configuration file

Set on your configuration file

'modules' => [ 

    // Yii2 Menu
    'menu' => [
        'class' => 'cinghie\menu\Menu',
        'menuRoles' => ['admin'],
    ],

]   

Overrides

Override controller example, on modules config

'modules' => [ 

    'menu' => [
        'class' => 'cinghie\menu\Menu',
        'controllerMap' => [
            'items' => 'app\controllers\ItemsController',
            'types' => 'app\controllers\TypesController',
        ]
    ]

],

Override models example, on modules config

'modules' => [ 

    'menu' => [
        'class' => 'cinghie\menu\Menu',
        'modelMap' => [
            'Items' => 'app\models\menu\Items',
            'Types' => 'app\models\menu\Types',
        ]
    ]

],

Override view example, on components config

'components' => [ 

    'view' => [
        'theme' => [
            'pathMap' => [
                '@cinghie/menu/views/items' => '@app/views/menu/items',
                '@cinghie/menu/views/types' => '@app/views/menu/types',
            ],
        ],
    ],

],

URLS

  • Menù Types: PathToApp/index.php?r=menu/types/index
  • Menù Types with Pretty Urls: PathToApp/menu/types/index
  • Menù Items: PathToApp/index.php?r=menu/items/index
  • Menù Items with Pretty Urls: PathToApp/menu/items/index

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



0.9.6 is the latest of 9 releases



BSD-3-Clause license
Stats
10 github stars & 7 github forks
0 downloads in the last day
0 downloads in the last 30 days
1005 total downloads