Hello!
I’m a newbie of YII.
I want to utilize a foreign link on my site, how to make it work.
The link is like the YII home page, the link is Development
The code of HTML is shown below:
<li class="development"><a class="main" href="github.com/yiisoft/yii/commits/master">Development</a>
Please help me found out the reasons, thanks.
<?php
NavBar::begin([
'brandLabel' => 'YII',
'brandUrl' => Yii::$app->homeUrl,
'options' => [
'class' => 'navbar-inverse navbar-fixed-top',
],
]);
$menuItems = [
['label' => 'Home', 'url' => ['/site/index']],
['label' => 'About', 'url' => ['/site/about']],
['label' => 'Contact', 'url' => ['/site/contact']],
['label' => 'Notes', 'url' => ['/notes/index']],
];
if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']];
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
$menuItems[] = ['label' => 'Development', 'link' => 'github.com/yiisoft/yii/commits/master','linkOptions' => array('target' => '_blank')];
} else {
$menuItems[] = [
'label' => 'Logout (' . Yii::$app->user->identity->username . ')',
'url' => ['/site/logout'],
'linkOptions' => ['data-method' => 'post']
];
}
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
'items' => $menuItems,
]);
NavBar::end();
?>
I use the code above, however, there is no link but open a new window.
“The https is deleted, for I’m a newbie and don’t have access to use link”