yii2-foundation-topbar a deeper menu as bootstrap , mobile,tablet responsive

  1. Requirements
  2. Usage
  3. Resources

deeper Menu widget for yii2 from http://foundation.zurb.com/docs/components/topbar.html

Requirements

yii2 php 5.4 >internet Explorer 8

Usage

<?php
use drmabuse\foundationTopbar\FoundationNavbar;
use drmabuse\foundationTopbar\FoundationNav;


FoundationNavbar::begin([
    'title' => [
        'name'      => Yii::$app->name,
        'nameUrl'   => Yii::$app->homeUrl,
    ],
    'options' => [
        'navOptions' => [
            'class' => 'special',
            'data-options' => 'is_hover:false'
        ],
        'titleAreaOptions' => [
            'class' => 'special1'
        ],
        'sectionOptions' => [
            'class' => 'special2'
        ]
    ],
    'contain' => [
        'class' => 'fixed'
    ]
]);

    $menuItems = [
        ['label' => 'Home', 'url' => [Yii::$app->homeUrl]],
        [
            'label' => 'Menü',
            'items' =>[
                ['label' => 'Home', 'url' => ['/site/index']],
                ['label' => 'About', 'url' => ['/site/about']],
                ['label' => 'Submenu2','items' => [
                    [
                        'label' => 'Verwaltung',
                        'url' => ['/mediating/mediatingimage/index']
                    ],
                    [
                        'label' => 'Neu +',
                        'url' => ['/mediating/mediatingimage/create'],
                    ]
                ]]
            ],
        ],
    ];

    if (Yii::$app->user->isGuest) {
        $menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']];
        $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
    } else {
        $menuItems[] = ['label' => 'Logout (' . Yii::$app->user->identity->username . ')', 'url' => ['/site/logout']];
    }

    echo FoundationNav::widget([
        'options' => ['class' => 'right'],
        'items' => $menuItems,
        'encodeLabels' => false
    ]);

FoundationNavbar::end();?>

Resources

0 0
2 followers
0 downloads
Yii Version: Unknown
License: BSD-2-Clause
Category: Others
Developed by: DrMabuse
Created on: Mar 4, 2014
Last updated: 10 years ago