Class hscstudio\heart\widgets\SideNavMetro
Inheritance | hscstudio\heart\widgets\SideNavMetro » kartik\widgets\SideNav |
---|
A custom extended side navigation menu extending Yii Menu
For example:
echo SideNav::widget([
'items' => [
[
'url' => ['/site/index'],
'label' => 'Home',
'icon' => 'home'
],
[
'url' => ['/site/about'],
'label' => 'About',
'icon' => 'info-sign',
'items' => [
['url' => '#', 'label' => 'Item 1'],
['url' => '#', 'label' => 'Item 2'],
],
],
],
]);
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$colors | hscstudio\heart\widgets\SideNavMetro | ||
$indItem | string | Indicator for a menu sub-item | hscstudio\heart\widgets\SideNavMetro |
$indMenuClose | string | Indicator for a closed sub-menu | hscstudio\heart\widgets\SideNavMetro |
$indMenuOpen | string | Indicator for a opened sub-menu | hscstudio\heart\widgets\SideNavMetro |
Public Methods
Method | Description | Defined By |
---|---|---|
init() | hscstudio\heart\widgets\SideNavMetro | |
run() | Renders the side navigation menu. | hscstudio\heart\widgets\SideNavMetro |
Protected Methods
Method | Description | Defined By |
---|---|---|
markTopItems() | Marks each topmost level item which is not a submenu | hscstudio\heart\widgets\SideNavMetro |
renderItem() | Renders the content of a side navigation menu item. | hscstudio\heart\widgets\SideNavMetro |
renderMenu() | Renders the main menu | hscstudio\heart\widgets\SideNavMetro |
validateItems() | Validates each item for a valid label and url. | hscstudio\heart\widgets\SideNavMetro |
Property Details
$colors = ['stick-red', 'stick-yellow', 'stick-green', 'stick-blue', 'stick-light-blue', 'stick-aqua', 'stick-navy', 'stick-teal', 'stick-olive', 'stick-lime', 'stick-orange', 'stick-fuchsia', 'stick-purple', 'stick-maroon', 'stick-black']
Indicator for a menu sub-item
Indicator for a closed sub-menu
Indicator for a opened sub-menu
Method Details
void init( ) |
Marks each topmost level item which is not a submenu
void markTopItems( ) |
Renders the content of a side navigation menu item.
string renderItem( $item ) | ||
$item | array | The menu item to be rendered. Please refer to \hscstudio\heart\widgets\items to see what data might be in the item. |
return | string | The rendering result |
---|---|---|
throws | \yii\base\InvalidConfigException |
Renders the main menu
void renderMenu( ) |
Renders the side navigation menu.
with the heading and panel containers
void run( ) |
Validates each item for a valid label and url.
void validateItems( $item ) | ||
$item | ||
throws | \yii\base\InvalidConfigException |
---|