Yii2 Menu to create, manage, and delete menù in a Yii2 site
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require cinghie/yii2-menu "*"
or add
"cinghie/yii2-menu": "*"
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
https://github.com/cinghie/yii2-multilanguage
Set on your configuration file
'modules' => [
// Yii2 Menu
'menu' => [
'class' => 'cinghie\menu\Menu',
'menuRoles' => ['admin'],
],
]
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',
],
],
],
],
Comments