Answer the question
In order to leave comments, you need to log in
Yii how to replace %2F with normal slash in address bar?
In general, I want to get a normal readable address so that without straining you can immediately see what kind of controller and action it is, but the% 2F sign plunges me into melancholy and autumn despondency.
How to turn this: /index.php?r=items%2Fview&id=1
into this: /index.php?r=items/view&id=1
("beautiful" url site.ru/items/1 has already been done, I know how to do it , but for learning I think that it will be useful to see everything as it was originally)
Answer the question
In order to leave comments, you need to log in
If you do not use enablePrettyUrl
and look at the method UrlManager::createUrl()
, then we will see the process of link formation:
$url = "$baseUrl?{$this->routeParam}=" . urlencode($route);
if (!empty($params) && ($query = http_build_query($params)) !== '') {
$url .= '&' . $query;
}
return $url . $anchor;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question