Exemple #1
0
?>
</title>
    <?php 
$this->head();
?>
</head>
<body>
<?php 
$this->beginBody();
?>

<div class="wrap">
    <?php 
NavBar::begin(['brandLabel' => Yii::$app->name, 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
Admin::getCountMessages() ? $menuItems[] = ['label' => '<i class="glyphicon glyphicon-envelope"></i> ' . Module::t('module', 'ADMIN_NAV_MENU_MESSAGES_{msg}', ['msg' => Admin::getCountMessages()]), 'url' => ['/admin/blog/comment/index']] : false;
Admin::getCountCommentPending() ? $menuItems[] = ['label' => '<i class="glyphicon glyphicon-comment"></i> ' . Module::t('module', 'ADMIN_NAV_MENU_COMMENTARIES_{comment}', ['comment' => Admin::getCountCommentPending()]), 'url' => ['/admin/blog/comment/index']] : false;
Yii::$app->user->can(User::ROLE_USER) ? $menuItems[] = ['label' => Yii::t('app', 'HELLO{username}', ['username' => Yii::$app->user->identity->profile->name ? Yii::$app->user->identity->profile->name . ' ' . Yii::$app->user->identity->profile->surname : Yii::$app->user->identity->username]), 'items' => [['label' => '<i class="glyphicon glyphicon-dashboard"></i> ' . Yii::t('app', 'MENU_ADMIN'), 'url' => ['/admin/default/index'], 'visible' => Yii::$app->user->can(User::ROLE_MODER)], ['label' => '<i class="glyphicon glyphicon-user"></i> ' . Yii::t('app', 'MENU_PROFILE'), 'url' => ['/user/profile/index']], '<li class="divider"></li>', ['label' => '<i class="glyphicon glyphicon-log-out"></i> ' . Yii::t('app', 'MENU_LOGOUT'), 'url' => ['/user/default/logout'], 'linkOptions' => ['data-method' => 'post']]]] : false;
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'encodeLabels' => false, 'items' => array_filter($menuItems)]);
NavBar::end();
?>

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