main.php 1.63 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
 */
10
app\config\AppAsset::register($this);
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(); ?>
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
	<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			<?php echo Html::a('My Company', Yii::$app->homeUrl, array('class' => 'navbar-brand')); ?>
			<div class="nav-collapse collapse pull-right">
				<?php echo Menu::widget(array(
					'options' => array('class' => 'nav navbar-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')),
					),
				)); ?>
			</div>
		</div>
	</div>
Qiang Xue committed
40

41 42 43
	<div class="container">
		<?php echo Breadcrumbs::widget(array(
			'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : array(),
44
		)); ?>
45
		<?php echo $content; ?>
Qiang Xue committed
46
	</div>
Qiang Xue committed
47

48 49 50 51 52 53
	<footer class="footer">
		<div class="container">
			<p class="pull-left">&copy; My Company <?php echo date('Y'); ?></p>
			<p class="pull-right"><?php echo Yii::powered(); ?></p>
		</div>
	</footer>
Qiang Xue committed
54

55
<?php $this->endBody(); ?>
Qiang Xue committed
56 57
</body>
</html>
Zander Baldwin committed
58
<?php $this->endPage(); ?>