Home  >  Article  >  PHP Framework  >  How to cancel URL verification in yii2

How to cancel URL verification in yii2

王林
王林Original
2020-02-17 14:02:511812browse

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;
}

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!

Statement:
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