I
I
ImPuuLsE2015-05-11 18:11:36
Yii
ImPuuLsE, 2015-05-11 18:11:36

How to remove %2F character instead of / in url formation in Yii2?

Url::to(['/'.$this->context->module->id.'/'.$this->context->id.'/category/', 'alias'=>$category->full_url])

where $category->full_url = category/subCategory
in the output - organizations/category/kompyuter-internet-telefon%2F1s-prodazha-vnedrenie-soprovozhdenie
Please tell me how to solve the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
matperez, 2015-05-11
@ImPuuLsE

When writing a routing rule, add encodeParams = false. Details here www.yiiframework.com/doc-2.0/yii-web-urlrule.html#...

R
RomkaChev, 2015-05-11
@RomkaChev

Try it:
urldecode(Url::to(...))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question