L
L
lilwings2020-02-21 23:39:29
Yii
lilwings, 2020-02-21 23:39:29

Yii2 not working URL::toRoute?

I generate a link to action -> info, controller -> site:

<a href="<?= Url::toRoute('site/info') ?>" class="link">Подробнее</a>


But the link looks like this:

http://site/info

In the first one, why doesn't the connection to the controller work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-02-21
@lilwings

The problem is in urlManagera routes. Set the rule to the first route like this:
'site/info' => 'site/info'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question