我的配置
'modules' => [
'admin' => [
'class' => 'backend\modules\admin\Module',
],
],
'urlManager' => [
'enablePrettyUrl' => true,
'enableStrictParsing' => false,
'showScriptName' => false,
'rules' => include __DIR__ . '/route.php',
],
route.php
return [
[
'class' => 'yii\rest\UrlRule',
'controller' => [
'admin/user',
'admin/route',
'admin/rule',
],
'extraPatterns' => [
'PUT update/<id:\d+>' => 'update',
],
'pluralize' => false,
],
当PUT路由admin / rule / update / 1休止404时
web / urlRUle var_dump($ this-> pattern)是'#^ admin / rule / update /(?P \ d +)$#u'
请帮助我,谢谢。