Example #1
0
<?php

use common\components\MenuHelper;
$category = MenuHelper::getAllMenu();
?>
<div class="sidemenu-left ps-container ps-active-y" id="sidebar-wrapper" data-ps-id="b4218f6b-83f4-8723-4daa-8c88aad5b8bf">
    <div class="hidden-lg hidden-md">
        <!-- menu -->
        <div class="pav-mainnav" id="pav-mainnav">
            <div class="pav-megamenu-mb">
                <button type="button" class="btn btn-primary canvas-menu hidden-lg hidden-md" data-toggle="offcanvas"><span class="fa fa-bars"></span> Menu</button>
                <nav class="hidden-sm hidden-xs" id="pav-megamenu">
                    <div class="navbar">
                        <div role="navigation" class="megamenu" id="mainmenutop">
                            <div class="navbar-header">
                                <div id="bs-megamenu" class="collapse navbar-collapse">
                                    <ul class="nav navbar-nav megamenu">
                                        <li class="parent dropdown home aligned-left">
                                            <a href="" data-toggle="dropdown" class="dropdown-toggle"><span class="menu-title">Home</span></a>
                                        </li>
                                        <li class=" aligned-left parent dropdown ">
                                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                                <span class="menu-title">Categories</span><b class="caret"></b>
                                            </a>
                                            <div style="width:800px" class="dropdown-menu">
                                                <div class="dropdown-menu-inner">
                                                    <div class="row">
                                                        <div class="mega-col col-xs-12 col-sm-12 col-md-3 "> 
                                                            <div class="mega-col-inner">
                                                                <?php 
foreach ($category['categories'] as $key => $value) {
Example #2
0
$menus[] = ['label' => Yii::t('igolf', 'Home'), 'url' => ['/site/index']];
// admin stuff
if (in_array($role, ['admin', 'super'])) {
    $menus[] = ['label' => Yii::t('igolf', 'Site admin'), 'url' => ['/admin']];
}
// golf league stuff
if ($role) {
    $menus[] = ['label' => Yii::t('igolf', 'Golf League'), 'items' => MenuHelper::getMenu($role)];
}
if (!Yii::$app->user->isGuest) {
    $who = Yii::$app->user->identity->username;
    if (YII_DEBUG) {
        $who .= $role ? '/' . $role : '/?';
    }
    if (YII_ENV == 'dev') {
        $menus[] = ['label' => Yii::t('igolf', 'Development'), 'items' => MenuHelper::getDeveloperMenu($role)];
    }
    $user_menu = [];
    $user_menu[] = ['label' => Yii::t('igolf', 'Profile'), 'url' => ['/user/settings']];
    $user_menu[] = ['label' => Yii::t('igolf', 'Logout'), 'url' => ['/user/security/logout'], 'linkOptions' => ['data-method' => 'post']];
    $menus[] = ['label' => $who, 'items' => $user_menu];
} else {
    $menus[] = ['label' => 'Login', 'url' => ['/user/security/login']];
}
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => $menus]);
NavBar::end();
?>

        <div class="container">
            <?php 
echo Breadcrumbs::widget(['homeLink' => ['label' => Yii::$app->name, 'url' => Yii::$app->homeUrl], 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
Example #3
0
<?php

use common\components\MenuHelper;
use frontend\assets\AppAsset;
use frontend\widgets\Alert;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
/* @var $this \yii\web\View */
/* @var $content string */
if (isset(Yii::$app->params['BootswatchTheme'])) {
    raoul2000\bootswatch\BootswatchAsset::$theme = Yii::$app->params['BootswatchTheme'];
}
$asset = AppAsset::register($this);
$role = MenuHelper::getRole();
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php 
echo Yii::$app->language;
?>
">
<head>
    <meta charset="<?php 
echo Yii::$app->charset;
?>
"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php 
echo Html::csrfMetaTags();