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

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

		<div class="navbar">
			<div class="navbar-inner">
				<div class="container">
29
					<?php echo Menu::widget(array(
30 31 32 33 34 35 36 37 38 39
						'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
40 41 42 43
				</div>
			</div>
		</div>
		<!-- /.navbar -->
Qiang Xue committed
44
	</div>
Qiang Xue committed
45

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

51 52
	<hr>

Qiang Xue committed
53 54 55 56 57 58 59 60
	<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>
</div>
61
<?php $this->endBody(); ?>
Qiang Xue committed
62 63
</body>
</html>
Zander Baldwin committed
64
<?php $this->endPage(); ?>