alex290/yii2-multinav

Yii2 Multilevel Nav hover

Installs: 23

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

1.1.2 2023-04-24 16:59 UTC

This package is auto-updated.

Last update: 2024-04-24 19:11:01 UTC


README

Yii2 Multilevel Nav hover

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist alex290/yii2-multinav "*"

or add

"alex290/yii2-multinav": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

echo Nav::widget([
        'items' => [
            [
                'label' => 'Home',
                'url' => ['site/index'],
                'linkOptions' => [],
            ],
            [
                'label' => 'Dropdown',
                 'items' => [
                     [
                         'label' => 'Dropdown',
                         'items' => [
                             ['label' => 'Level 1 - Dropdown A', 'url' => '#'],
                             ['label' => 'Level 1 - Dropdown B', 'url' => '#'],
                         ],
                     ],
                     ['label' => 'Level 1 - Dropdown A', 'url' => '#'],
                     ['label' => 'Level 1 - Dropdown B', 'url' => '#'],
                 ],
            ],
        ],
        'options' => [
            'class' =>'nav-pills', // set this to nav-tabs to get tab-styled navigation
            'backgroundColor' => '#222', // Цвет фона меню
            'backgroundColorHover' => '#3d3d3d', // Цвет пункта меню при наведении
            'backgroundColorActive' => '#3d3d3d', // Цвет пункта меню активного
            'color' => '#fff', // Цвет текста меню
            'colorActive' => '#fff', // Цвет текста меню активного
            'colorHover' => '#fff', // Цвет текста меню при наведении
        ],
    ]);