main.php 1.64 KB
Newer Older
Qiang Xue committed
1
<?php
2 3
use yii\helpers\Html;
use yii\widgets\Menu;
4 5
use yii\widgets\Breadcrumbs;
use yii\debug\Toolbar;
6

Qiang Xue committed
7 8 9 10
/**
 * @var $this \yii\base\View
 * @var $content string
 */
Qiang Xue committed
11
$this->registerAssetBundle('app');
Qiang Xue committed
12
?>
Qiang Xue committed
13
<?php $this->beginPage(); ?>
Qiang Xue committed
14
<!DOCTYPE html>
Qiang Xue committed
15
<html lang="en">
Qiang Xue committed
16
<head>
Qiang Xue committed
17
	<meta charset="utf-8"/>
Qiang Xue committed
18 19 20 21
	<title><?php echo Html::encode($this->title); ?></title>
	<?php $this->head(); ?>
</head>
<body>
Qiang Xue committed
22 23 24 25 26 27 28 29
<div class="container">
	<?php $this->beginBody(); ?>
	<div class="masthead">
		<h3 class="muted">My Company</h3>

		<div class="navbar">
			<div class="navbar-inner">
				<div class="container">
30
					<?php echo Menu::widget(array(
31 32 33 34 35 36 37 38 39 40
						'options' => array('class' => 'nav'),
						'items' => array(
							array('label' => 'Home', 'url' => array('/site/index')),
							array('label' => 'About', 'url' => array('/site/about')),
							array('label' => 'Contact', 'url' => array('/site/contact')),
							Yii::$app->user->isGuest ?
								array('label' => 'Login', 'url' => array('/site/login')) :
								array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')),
						),
					)); ?>
Qiang Xue committed
41 42 43 44
				</div>
			</div>
		</div>
		<!-- /.navbar -->
Qiang Xue committed
45
	</div>
Qiang Xue committed
46

47
	<?php echo Breadcrumbs::widget(array(
48 49
		'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : array(),
	)); ?>
Qiang Xue committed
50 51
	<?php echo $content; ?>

52 53
	<hr>

Qiang Xue committed
54 55 56 57 58 59 60 61 62
	<div class="footer">
		<p>&copy; My Company <?php echo date('Y'); ?></p>
		<p>
			<?php echo Yii::powered(); ?>
			Template by <a href="http://twitter.github.io/bootstrap/">Twitter Bootstrap</a>
		</p>
	</div>
	<?php $this->endBody(); ?>
</div>
63
<?php echo Toolbar::widget(); ?>
Qiang Xue committed
64 65
</body>
</html>
Zander Baldwin committed
66
<?php $this->endPage(); ?>