Пример #1
0
<?php

use fourteenmeister\extensions\SemanticUI\collections\Menu;
echo Menu::widget(['id' => 'footer', 'options' => ['tag' => 'footer', 'class' => 'small bottom fixed'], 'items' => [['label' => '&copy; Custom Yii2 Advanced ' . date('Y'), 'url' => 'https://github.com/fourteenmeister/yii2-app-advanced', 'encode' => false, 'options' => ['class' => 'header', 'target' => '_blank']]], 'rightMenuItems' => [['label' => Yii::powered(), 'encode' => false, 'options' => ['style' => 'display: block;']]]]);
Пример #2
0
<?php

/* @var $this \yii\web\View */
use fourteenmeister\extensions\SemanticUI\collections\Menu;
use fourteenmeister\extensions\SemanticUI\Elements;
echo Menu::widget(['id' => 'menu', 'items' => [['label' => Elements::icon('home') . 'Главная', 'url' => ['/site/index'], 'encode' => false], ['label' => Elements::icon('info circle') . 'О сайте', 'url' => ['/site/about'], 'encode' => false]], 'rightMenuItems' => [['label' => Yii::$app->user->isGuest ? Elements::icon('user') . 'Здравствуйте, <strong>гость</strong>' : Elements::icon('user') . 'Здравствуйте, <strong>' . \Yii::$app->user->identity->username . '</strong>', 'items' => [['label' => Elements::icon('settings') . 'Панель управления', 'url' => ['/admin/site/index'], 'encode' => false, 'visible' => Yii::$app->user->can('superuser')], ['label' => Elements::icon('sign in') . 'Войти', 'url' => ['/users/auth/login'], 'encode' => false, 'visible' => Yii::$app->user->isGuest], ['label' => Elements::icon('add user') . 'Регистрация', 'url' => ['/users/auth/signup'], 'encode' => false, 'visible' => Yii::$app->user->isGuest], ['label' => Elements::icon('sign out') . 'Выйти', 'url' => ['/users/auth/logout'], 'encode' => false, 'visible' => !Yii::$app->user->isGuest]], 'encode' => false, 'options' => ['style' => 'display: block;']]], 'options' => ['class' => 'top fixed small']]);