A
A
armstrong852021-05-04 11:49:00
Yii
armstrong85, 2021-05-04 11:49:00

Correct url link?

The config contains: 'baseUrl' => '/admin'. When writing, Url::to([Url::current(), 'lang_admin' => 'ru' ]) The link has an address, for example admin/admin/blog/page/index?lang_admin=ru . Why is admin written 2 times and how to remove it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MikUrrey, 2021-05-04
@armstrong85

I think the mistake is that you are using current inside to.
Try one of these examples and you will get the desired result:

Url::current(['lang_admin' => 'ru']);
Url::to(['lang_admin' => 'ru']);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question