I got one awkward issue.
My views/layout/main.php is:
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
'items' => [
Yii::$app->user->isGuest ?
['label' => 'Register', 'url' =>['users/users/register']]:
['label' => 'D',''=>''],
['label' => 'Home', 'url' => ['users/users/index']],
['label' => 'About', 'url' => ['users/users/about']],
],
]);
NavBar::end();
?>
Whenever I'm clicking On Home Tab, Page is opening. Its Ok.
http://localhost/mylawsuit/yii/web/index.php?r=users/users/index
Again Clicking on Home Tab, Page giving error Like
Page Not Found.
http://localhost/mylawsuit/yii/web/index.php?r=users/users/users/index
In Url, one more "users" getting appendend in middle. That's why Page Not Found Coming. Users is one module.
Again, clicking On Home Tab, Page is coming without error. Means Original Page Coming.
For me, i've to click 2 times each on every tab to get original page. First time, error. Second Time, Original Page.
But, I solved it by changing 'url' => ['users/users/index']]
of main.php to 'url' => ['/users/users/index']],
means adding one forward slash to URL. It's working fine.
What may be the issue. Or Writing like this 'url' => ['/users/users/index']]
is the main syntax. Forgive me, If this is the syntax to write the URL.