A
A
Artur Khismatullin2017-04-09 10:49:27
Yii
Artur Khismatullin, 2017-04-09 10:49:27

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 answer(s)
M
Maxim Timofeev, 2017-04-09
@webinar

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',
],

3. If you want to use routes, then this is how it should be:
Url::toRoute(['site/about'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question