cinghie / yii2-menu
Yii2 Menu to create, manage, and delete dynamic menus in a Yii2 site.
Installs: 1 013
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 5
Forks: 7
Open Issues: 2
Type:yii2-extension
Requires
- cinghie/yii2-multilanguage: @dev
- cinghie/yii2-traits: @dev
- yiisoft/yii2: ~2.0.14
README
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