示例#1
0
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <title><?php 
echo Html::encode($this->title);
?>
</title>
	<?php 
echo Html::csrfMetaTags();
?>
    <?php 
$this->head();
?>
</head>
<body class="skin-blue">
<?php 
$this->beginBody();
Header::begin(['brandLabel' => 'My Company', 'brandLabel' => Yii::$app->name, 'brandUrl' => Yii::$app->homeUrl, 'options' => ['tag' => 'header', 'class' => 'header']]);
NavBar::begin(['options' => ['class' => 'navbar-static-top']]);
$menuItems = [];
if (Yii::$app->user->isGuest) {
    $menuItems[] = ['content' => NavBarUser::Widget(), 'options' => ['class' => '']];
} else {
    //$menuItems[] = ['content'=> NavBarMessage::Widget(),'options'=>['class'=>'dropdown messages-menu']];
    //$menuItems[] = ['content'=> NavBarNotification::Widget(),'options'=>['class'=>'dropdown notifications-menu']];
    //$menuItems[] = ['content'=> NavBarTask::Widget(),'options'=>['class'=>'dropdown tasks-menu']];
    $menuItems[] = ['content' => NavBarUser::Widget(), 'options' => ['class' => 'dropdown user user-menu']];
}
echo Nav::widget(['options' => ['class' => 'nav navbar-nav'], 'items' => $menuItems]);
NavBar::end();
Header::end();
?>
    
示例#2
0
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <title><?php 
echo Html::encode($this->title);
?>
</title>
	<?php 
echo Html::csrfMetaTags();
?>
    <?php 
$this->head();
?>
</head>
<body class="skin-blue">
<?php 
$this->beginBody();
Header::begin(['brandLabel' => 'My Company', 'brandLabel' => Html::img($asset_bundle->baseUrl . '/img/wh_logo.png') . " What's Hot CMS", 'brandUrl' => Yii::$app->homeUrl, 'options' => ['tag' => 'header', 'class' => 'header']]);
NavBar::begin(['options' => ['class' => 'navbar-static-top']]);
$menuItems = [];
if (Yii::$app->user->isGuest) {
    $menuItems[] = ['content' => NavBarUser::Widget(), 'options' => ['class' => '']];
} else {
    $menuItems[] = ['content' => NavBarMessage::Widget(), 'options' => ['class' => 'dropdown messages-menu']];
    //$menuItems[] = ['content'=> NavBarNotification::Widget(),'options'=>['class'=>'dropdown notifications-menu']];
    //$menuItems[] = ['content'=> NavBarTask::Widget(),'options'=>['class'=>'dropdown tasks-menu']];
    $menuItems[] = ['content' => NavBarUser::Widget(), 'options' => ['class' => 'dropdown user user-menu']];
}
echo Nav::widget(['options' => ['class' => 'nav navbar-nav'], 'items' => $menuItems]);
NavBar::end();
Header::end();
?>