Answer the question
In order to leave comments, you need to log in
When you click on the link, it shows an empty page like yii2?
in web.php I wrote
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'action' => 'site/about',
'action' => 'site/ portfolio',
'action' => 'site/blog',
'action' => 'site/contact',
],
],
When going to some page, it gives an empty view, although there is markup.
I do the link like this Url::to('site/about')
Answer the question
In order to leave comments, you need to log in
1. Instead of
explicitly
2. Your code makes no sense. You probably need this:
'rules' => [
'about' => 'site/about',
'portfolio' => 'site/portfolio',
'blog' => 'site/blog',
'contact'=>'site/contact',
],
Url::toRoute(['site/about'])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question