示例#1
0
文件: main.php 项目: oke11o/seokeys
use app\components\widgets\Alert;
use app\modules\admin\rbac\Rbac as AdminRbac;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
/* @var $this \yii\web\View */
/* @var $content string */
$this->beginContent('@app/views/layouts/layout.php');
?>

<?php 
NavBar::begin(['brandLabel' => Yii::$app->name, 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'activateParents' => true, 'items' => array_filter([['label' => Yii::t('app', 'NAV_HOME'), 'url' => ['/main/default/index']], ['label' => Yii::t('app', 'NAV_CONTACT'), 'url' => ['/main/contact/index']], Yii::$app->user->isGuest ? ['label' => Yii::t('app', 'NAV_SIGNUP'), 'url' => ['/user/default/signup']] : false, Yii::$app->user->isGuest ? ['label' => Yii::t('app', 'NAV_LOGIN'), 'url' => ['/user/default/login']] : false, Yii::$app->user->can(AdminRbac::PERMISSION_ADMIN_PANEL) ? ['label' => Yii::t('app', 'NAV_ADMIN'), 'url' => ['/admin/default/index']] : false, !Yii::$app->user->isGuest ? ['label' => Yii::t('app', 'NAV_PROFILE'), 'items' => [['label' => Yii::t('app', 'NAV_PROFILE'), 'url' => ['/user/profile/index']], ['label' => Yii::t('app', 'NAV_LOGOUT'), 'url' => ['/user/default/logout'], 'linkOptions' => ['data-method' => 'post']]]] : false])]);
NavBar::end();
?>

<div class="container">
    <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
    <?php 
echo Alert::widget();
?>
    <?php 
echo $content;
?>
</div>

<?php 
$this->endContent();
示例#2
0
?>
    <div class="wrap">
        <?php 
//TODO переделать меню под нормальный вид
NavBar::begin(['brandLabel' => 'MYKEYWORDS.RU', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => [['label' => 'Главная', 'url' => ['/site/index'], 'visible' => Yii::$app->user->isGuest], ['label' => 'О нас', 'url' => ['/site/about'], 'visible' => Yii::$app->user->isGuest], ['label' => 'Контакты', 'url' => ['/site/contact'], 'visible' => Yii::$app->user->isGuest], ['label' => 'Пользователи', 'url' => ['/user/admin/'], 'visible' => Yii::$app->user->identity && Yii::$app->user->identity->isAdmin()], ['label' => 'Профиль', 'url' => ['/user/default/profil/'], 'visible' => !Yii::$app->user->isGuest], ['label' => 'Изменить пароль', 'url' => ['/user/default/change-password/'], 'visible' => !Yii::$app->user->isGuest], ['label' => 'Задания', 'url' => ['/tasks/'], 'visible' => !Yii::$app->user->isGuest], ['label' => 'Тикеты', 'url' => ['/ticket/'], 'visible' => !Yii::$app->user->isGuest], ['label' => 'Финансы', 'url' => ['/financy/'], 'visible' => !Yii::$app->user->isGuest], Yii::$app->user->isGuest ? ['label' => 'Регистрация', 'url' => ['/user/default/signup']] : '', Yii::$app->user->isGuest ? ['label' => 'Авторизация', 'url' => ['/user/default/login']] : ['label' => 'Выход (' . Yii::$app->user->identity->username . ')', 'url' => ['/user/default/logout'], 'linkOptions' => ['data-method' => 'post']]]]);
NavBar::end();
?>

        <div class="container">
            <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) && !Yii::$app->user->isGuest ? $this->params['breadcrumbs'] : []]);
?>

            <?php 
Alert::widget();
?>

            <?php 
echo $content;
?>

        </div>
    </div>

    <footer class="footer">
        <div class="container">
            <p class="pull-left">&copy;MYKEYWORDS.RU <?php 
echo date('Y');
?>
</p>