Home Backend Development PHP Tutorial How to deal with the routing link being escaped in Yii2.0 Basic code

How to deal with the routing link being escaped in Yii2.0 Basic code

Jun 15, 2018 pm 03:05 PM
basic routing

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方法)
Copy after login

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

3 Ways to Fix Router Lost Contact with NTP Time Server Error 3 Ways to Fix Router Lost Contact with NTP Time Server Error May 22, 2023 pm 03:43 PM

Connection and WiFi issues can be very frustrating and significantly reduce productivity. Computers use Network Time Protocol (NTP) for clock synchronization. In most cases, if not all, your laptop uses NTP to track time. If your server has lost contact due to NTP time server error message, read this article to the end to learn how to fix it. What happens when the router's time is set incorrectly? Router performance is generally not affected by incorrect time settings, so your connection may not be affected. However, some problems may arise. These include: Incorrect time for all gadgets that use the router as a local time server. The timestamps in the router log data will be wrong. if due to

How to Fix No Internet Security Issue on Windows 11/10 How to Fix No Internet Security Issue on Windows 11/10 May 11, 2023 pm 10:07 PM

One of the internet connection related issues seen on Windows 11/10 computers is the “No internet, secure” error message. Basically, this error message indicates that the system is connected to the network, but due to issues with the connection, you are unable to open any web pages and receive data. You may encounter this error while connecting to any network in Windows, preferably when connecting to the Internet through a WiFi router that is not nearby. Normally, when you check the wireless icon in the lower right corner of your system tray, you'll see a small yellow triangle, and when you click it, a No Internet, Security message will appear. There is no specific reason why this error message occurs, but changes to configuration settings may cause your router to be unable to connect

How to implement API routing in the Slim framework How to implement API routing in the Slim framework Aug 02, 2023 pm 05:13 PM

How to implement API routing in the Slim framework Slim is a lightweight PHP micro-framework that provides a simple and flexible way to build web applications. One of the main features is the implementation of API routing, allowing us to map different requests to corresponding handlers. This article will introduce how to implement API routing in the Slim framework and provide some code examples. First, we need to install the Slim framework. The latest version of Slim can be installed through Composer. Open a terminal and

Java Apache Camel: Building a flexible and efficient service-oriented architecture Java Apache Camel: Building a flexible and efficient service-oriented architecture Feb 19, 2024 pm 04:12 PM

Apache Camel is an Enterprise Service Bus (ESB)-based integration framework that can easily integrate disparate applications, services, and data sources to automate complex business processes. ApacheCamel uses route-based configuration to easily define and manage integration processes. Key features of ApacheCamel include: Flexibility: ApacheCamel can be easily integrated with a variety of applications, services, and data sources. It supports multiple protocols, including HTTP, JMS, SOAP, FTP, etc. Efficiency: ApacheCamel is very efficient, it can handle a large number of messages. It uses an asynchronous messaging mechanism, which improves performance. Expandable

How to use routing in ThinkPHP6 How to use routing in ThinkPHP6 Jun 20, 2023 pm 07:54 PM

ThinkPHP6 is a powerful PHP framework with convenient routing functions that can easily implement URL routing configuration; at the same time, ThinkPHP6 also supports a variety of routing modes, such as GET, POST, PUT, DELETE, etc. This article will introduce how to use ThinkPHP6 for routing configuration. 1. ThinkPHP6 routing mode GET method: The GET method is a method used to obtain data and is often used for page display. In ThinkPHP6, you can use the following

How to Fix iPhone WiFi Keeps Disconnecting Repeatedly [Solved] How to Fix iPhone WiFi Keeps Disconnecting Repeatedly [Solved] May 20, 2023 pm 01:55 PM

Many iPhone users have expressed disappointment with one of the serious issues they face on their iPhone. The problem is that their iPhone disconnects from Wi-Fi every now and then. This is indeed a major issue since Wi-Fi is a necessity to use most apps on your iPhone. We have thoroughly analyzed this issue and identified the factors that may be responsible and listed them below. Auto-join settings are disabled Some issues in network settings Change Wi-Fi password Changed Wi-Fi router issues After looking into these factors mentioned above, we have compiled a set of solutions that can fix disconnection issues with Wi-Fi issues iPhone. Fix 1 – Turn on Wi-Fi’s auto-join setting if Wi-Fi is not enabled

Can routing be used to defend against ARP spoofing, suppress broadcast storms, and defend against intranet viruses? Can routing be used to defend against ARP spoofing, suppress broadcast storms, and defend against intranet viruses? May 22, 2023 am 08:52 AM

The routes mentioned here are those above one thousand yuan, and we won’t talk about those below one thousand yuan. Nowadays, many enterprise routers say they have such a function, but such a function requires a prerequisite, that is, the computer must be directly connected to the router. If it is separated by a switch, these functions will be useless to the computer. Problems such as broadcast storms and ARP spoofing in the LAN are very common problems. They are not big problems, but they are very annoying. It is not difficult to solve broadcast storms, ARP spoofing or network loops. The difficulty lies in how to detect these problems. Recommend the "Buddha Nature" plug-in for our system. The reason why we say "Buddha nature" is because this detection function is based on Internet behavior management and the core of network monitoring data analysis, and only Internet behavior management can do it. It should have been placed in

How to use routing to customize page switching animation effects in a Vue project? How to use routing to customize page switching animation effects in a Vue project? Jul 21, 2023 pm 02:37 PM

How to use routing to customize page switching animation effects in a Vue project? Introduction: In the Vue project, routing is one of the functions we often use. Switching between pages can be achieved through routing, providing a good user experience. In order to make page switching more vivid, we can achieve it by customizing animation effects. This article will introduce how to use routing to customize the page switching animation effect in the Vue project. Create a Vue project First, we need to create a Vue project. You can use VueCLI to quickly build

See all articles