Home > PHP Framework > YII > body text

How to cancel URL verification in yii2

王林
Release: 2020-02-17 14:02:51
Original
1794 people have browsed it

How to cancel URL verification in yii2

Step one:

vendor/mdmsoft/yii2-admin/components/Configs.php

How to cancel URL verification in yii2

Step 2:

After this modification, MDM will only verify URLs that have been added to the permission system, and URLs that have not been added will not be verified.

(Recommended learning: yii framework)

In the permission management of the background management, delete the URLs that do not require verification from the registry.

The third step:

Turn off SCRF verification in the controller

How to cancel URL verification in yii2

Simple analysis:

$onlyRegisteredRoute parameter How does configuration work?

The execution of the tracking code found that the code in yii2-admin/components/Helper.php is as follows:

public static function checkRoute($route, $params = [], $user = null)
{
    $config = Configs::instance();
    $r = static::normalizeRoute($route);
    if ($config->onlyRegisteredRoute && !isset(static::getRegisteredRoutes()[$r])) {
        return true;
}
Copy after login

For more programming-related content, please visit the php Chinese websiteProgramming tutorial Column!

The above is the detailed content of How to cancel URL verification in yii2. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!