Skip to content

Yii2 Menu to create, manage, and delete dynamic menus in a Yii2 site.

Notifications You must be signed in to change notification settings

cinghie/yii2-menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Yii2 Menu to create, manage, and delete dynamic menus in a Yii2 site.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages