This article mainly introduces the relevant information on how to deal with the escape of routing links in the Yii2.0 Basic code. This article is very detailed with pictures and texts, and has reference value. Friends who are interested can take a look.
As usual, let’s talk about the operating environment and version numbers
OS: Windows10
Apache: 2.4
MySQL: 5.7.15
PHP: 7.0.11
Problem description: According to the prompts on the official website, I downloaded the basic version of the code, configured the virtual domain name, and opened the browser to access it (the specific process is omitted).
However, when you click on the link address, you will find that the link address has been escaped and "/" has become "/".
#Find the code, step by step.
Find the last yii-v2.0.9-basic\vendor\yiisoft\ In line 371 of yii2\web\UrlManager.php, I found that the url link was escaped by urlencode, so I removed it here. It's OK to visit again.
Finally paste the code to find the path:
yii-v2.0.9-basic\views\layouts\main.php yii-v2.0.9-basic\vendor\yiisoft\yii2-bootstrap\Nav.php (200行 Html::a()方法) yii-v2.0.9-basic\vendor\yiisoft\yii2-bootstrap\Html.php yii-v2.0.9-basic\vendor\yiisoft\yii2-bootstrap\BaseHtml.php yii-v2.0.9-basic\vendor\yiisoft\yii2\helpers\Html.php yii-v2.0.9-basic\vendor\yiisoft\yii2\helpers\BaseHtml.php yii-v2.0.9-basic\vendor\yiisoft\yii2\helpers\Url.php yii-v2.0.9-basic\vendor\yiisoft\yii2\helpers\BaseUrl.php(102行 static::getUrlManager()->createUrl) yii-v2.0.9-basic\vendor\yiisoft\yii2\web\UrlManager.php(371行 urlencode方法)
The above is the entire content of this article, I hope it will be helpful to everyone's study, more Please pay attention to the PHP Chinese website for related content!
Related recommendations:
Yii2 framework implements analysis of common database operations
yii2 component implements drop-down box with search function
The above is the detailed content of How to deal with the routing link being escaped in Yii2.0 Basic code. For more information, please follow other related articles on the PHP Chinese website!