Example #1
0
?>
        <title><?php 
echo 'GaServer';
?>
</title>
        <?php 
$this->head();
?>
    </head>
    <body>
        <?php 
$this->beginBody();
?>
        <div id="wrapper">
            <?php 
echo MenuWidget::widget();
?>
            <div id="page-wrapper">
                <div class="container-fluid">
                    <?php 
echo $content;
?>
                </div>
            </div>
        </div>
        <?php 
$this->endBody();
?>
    </body>
</html>
<?php 
 /**
  * @expectedExceptionMessage MenuWidget: items must be array
  * @expectedException \yii\base\Exception
  */
 public function test_badItems()
 {
     $mw = new MenuWidget(['items' => 'must be array']);
     $mw->run();
 }
Example #3
0
echo Yii::getAlias('@web');
?>
/assets/app/logo.ico" />
<?php 
echo Html::csrfMetaTags();
$this->head();
?>
</head>
<body>
<?php 
$this->beginBody();
?>
<header style="margin: auto !important; text-align: center; position: relative;">
	<form style="margin: 30px;">
	<?php 
echo MenuWidget::widget(['items' => [['link' => ['//site/index'], 'title' => \Yii::t('frontend/site', 'Library')], ['link' => ['//config/index'], 'title' => \Yii::t('frontend/site', 'Configuration')], ['link' => ['//site/about'], 'title' => \Yii::t('frontend/site', 'About {version}', ['version' => 'v.' . \Yii::$app->mycfg->version])], Yii::$app->user->isGuest ? ['link' => ['/site/login'], 'title' => \Yii::t('frontend/site', 'Login'), 'style' => 'color: white; background: green', 'id' => 'auth-link'] : ['link' => ['/site/logout'], 'title' => 'logout (' . Yii::$app->user->identity->username . ')', 'style' => 'color: white; background: #BDB437', 'id' => 'auth-link']]]);
?>
	</form>
<?php 
if (\Yii::$app->user->isGuest) {
    // append login form
    echo $this->renderFile(__DIR__ . '/_login.php');
} else {
    echo $this->renderFile(__DIR__ . '/_logout.php');
}
?>
</header>
<?php 
echo $content;
?>
<footer></footer>