Class hscstudio\heart\widgets\SideNavMetro

Inheritancehscstudio\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

Hide inherited properties

PropertyTypeDescriptionDefined 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

Hide inherited methods

MethodDescriptionDefined By
init() hscstudio\heart\widgets\SideNavMetro
run() Renders the side navigation menu. hscstudio\heart\widgets\SideNavMetro

Protected Methods

Hide inherited methods

MethodDescriptionDefined 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 public property
$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']
$indItem public property
string $indItem '<i class="indicatora fa fa-angle-right"></i> '

Indicator for a menu sub-item

$indMenuClose public property
string $indMenuClose '<i class="indicator fa fa-angle-double-left"></i>'

Indicator for a closed sub-menu

$indMenuOpen public property
string $indMenuOpen '<i class="indicatora fa fa-angle-double-down"></i>'

Indicator for a opened sub-menu

Method Details

init() public method

void init( )
markTopItems() protected method

Marks each topmost level item which is not a submenu

void markTopItems( )
renderItem() protected method

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
renderMenu() protected method

Renders the main menu

void renderMenu( )
run() public method

Renders the side navigation menu.

with the heading and panel containers

void run( )
validateItems() protected method

Validates each item for a valid label and url.

void validateItems$item )
$item
throws \yii\base\InvalidConfigException