2017 © Pedro Peláez
 

yii2-extension yii2-nav

Yii2 Role Based Navigation Module

image

chervand/yii2-nav

Yii2 Role Based Navigation Module

  • Tuesday, March 1, 2016
  • by chervand
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Yii2 Role Based Navigation Module

Data

TODO: TBA, (*1)

use \chervand\nav\traits\IdentityTrait;

Assignments

By default Nav assigns to identity's id, but you can implement your own assignment logic. You can do this by overriding [[IdentityTrait::getNavAssignment()]] relation., (*2)

class Identity extends ActiveRecord implements IdentityInterface
{
    use \chervand\nav\traits\IdentityTrait;
    ...
    public function getNavAssignment()
    {
        return $this->hasOne(Assignment::className(), ['assignment' => 'role_id'])
            ->orderBy('type ASC');
    }
    ...
}

Widget

<?= chervand\bootstrap\Nav::widget([
    'toggle' => 'collapse',
    'items' => Yii::$app->user->identity->navItemsAsArray,
    'options' => ['class' => 'nav nav-pills nav-stacked'],
]) ?>

The Versions

01/03 2016

dev-master

9999999-dev https://github.com/chervand/yii2-nav

Yii2 Role Based Navigation Module

  Sources   Download

MIT

The Requires

 

extension yii2 widget role navigation menu identity

25/02 2016

v1.1.1

1.1.1.0 https://github.com/chervand/yii2-nav

Yii2 Role Based Navigation Module

  Sources   Download

MIT

The Requires

 

extension yii2 widget role navigation menu identity

30/11 2015

v1.1.0

1.1.0.0 https://github.com/chervand/yii2-nav

Yii2 Role Based Navigation Module with collapsible Nav widget

  Sources   Download

MIT

The Requires

 

extension yii2 bootstrap widget role navigation menu nav identity

20/11 2015

v1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires