ipaya/yii2-widget-nav

The Nav widget for Yii2.

Installs: 84

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

0.1.1 2016-11-30 04:40 UTC

This package is auto-updated.

Last update: 2024-04-26 14:01:29 UTC


README

The Nav widget for Yii2.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist ipaya/yii2-widget-nav "*"

or add

"ipaya/yii2-widget-nav": "*"

to the require section of your composer.json file.

Usage

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

In Controller:

<?php

\iPaya\widgets\nav\Nav::setNavItems('main', [
    ['label'=>'首页','url'=>Yii::$app->homeUrl],
    ['label'=>'关于','url'=>['/site/about']]
]);

In View:

<?= \iPaya\widgets\nav\Nav::widget([
    'items'=>'main',
]); ?>```