yeesoft / yii2-yee-menu
Menu Module For Yee CMS
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 6 833
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 6
Open Issues: 2
Requires
- yeesoft/yii2-yee-core: ~0.1.0
This package is auto-updated.
Last update: 2022-03-29 00:26:25 UTC
README
Yii2 Framework - Yee CMS - Menu Module
Module for managing menus
This module is part of Yee CMS. This module allows you to create and manage menus on Yee Control Panel. Also, this module includes a widget to render menus on frontend.
Installation
- Either run
composer require --prefer-dist yeesoft/yii2-yee-menu "~0.1.0"
or add
"yeesoft/yii2-yee-menu": "~0.1.0"
to the require section of your composer.json
file.
- Run migrations:
yii migrate --migrationPath=@vendor/yeesoft/yii2-yee-menu/migrations/
Configuration
- In your backend config file
'modules'=>[ 'menu' => [ 'class' => 'yeesoft\menu\MenuModule', ], ],
Usage on frontend
- Widget namespace:
use yeesoft\menu\widgets\Menu;
- Render menu by ID:
echo Menu::widget(['id' => 'main-menu']);
Menu Widget Options
Use this options to configurate menu widget:
-
id
- Menu model id to render navigation. -
wrapper
- Menu wrapper - two dimensional array. First element will be placed before menu, second element will be placed after menu -
options
- Menu and submenus options.If
options
is one dimensional array then this options will be applied to all sub-menus. Example:'options' => ['class' => 'nav nav-menu']
If
options
is two dimensional array then this options will be applied according to nested submenu level. If there is no options for current level, default settings will be applied. Example:'options' => [ [ 'class' => 'nav nav-first-level'], [ 'class' => 'nav nav-second-level'] ]
-
encodeLabels
- Whether the nav items labels should be HTML-encoded. -
dropDownCaret
- This property allows you to customize the HTML which is used to generate the drop down caret symbol, which is displayed next to the button text to indicate the drop down functionality.Example of widget settings:
echo Menu::widget([ 'id' => 'main-menu', 'dropDownCaret' => '<span class="arrow"></span>', 'wrapper' => [ '<div class="navbar-default sidebar" role="navigation">', '</div>' ], 'options' => [ [ 'class' => 'nav nav-first-level'], [ 'class' => 'nav nav-second-level'], [ 'class' => 'nav nav-third-level'] ], ])