Home > Article > PHP Framework > How to cancel URL verification in yii2
Step one:
vendor/mdmsoft/yii2-admin/components/Configs.php
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
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!