Browse Source

Added signup link to frontend

tags/2.0.0-beta
Alexander Makarov 12 years ago
parent
commit
4b83aff0d7
  1. 23
      apps/advanced/frontend/views/layouts/main.php

23
apps/advanced/frontend/views/layouts/main.php

@ -27,17 +27,24 @@ AppAsset::register($this);
<div class="navbar"> <div class="navbar">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container"> <div class="container">
<?php echo Menu::widget(array( <?php
'options' => array('class' => 'nav'), $menuItems = array(
'items' => array(
array('label' => 'Home', 'url' => array('/site/index')), array('label' => 'Home', 'url' => array('/site/index')),
array('label' => 'About', 'url' => array('/site/about')), array('label' => 'About', 'url' => array('/site/about')),
array('label' => 'Contact', 'url' => array('/site/contact')), array('label' => 'Contact', 'url' => array('/site/contact')),
Yii::$app->user->isGuest ? );
array('label' => 'Login', 'url' => array('/site/login')) : if (Yii::$app->user->isGuest) {
array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')), $menuItems[] = array('label' => 'Signup', 'url' => array('/site/signup'));
), $menuItems[] = array('label' => 'Login', 'url' => array('/site/login'));
)); ?> }
else {
$menuItems[] = array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout'));
}
echo Menu::widget(array(
'options' => array('class' => 'nav'),
'items' => $menuItems,
));
?>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save