Yii 为什么这条路线不匹配
Yii why this route does not match
我想为文章路由创建简单的路由但没有成功。我有第一条路线应该匹配正则表达式,第二条路线应该匹配 slug 路线。第二个效果很好,但第一个不匹配任何东西。这条路线有什么问题?
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'article/<action: (index|view|delete|create|update)>' => 'article/<action>',
'article/<slug>' => 'article/view'
],
],
action:
后应该没有space:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'article/<action:(index|view|delete|create|update)>' => 'article/<action>',
'article/<slug>' => 'article/view'
],
],
我想为文章路由创建简单的路由但没有成功。我有第一条路线应该匹配正则表达式,第二条路线应该匹配 slug 路线。第二个效果很好,但第一个不匹配任何东西。这条路线有什么问题?
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'article/<action: (index|view|delete|create|update)>' => 'article/<action>',
'article/<slug>' => 'article/view'
],
],
action:
后应该没有space:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'article/<action:(index|view|delete|create|update)>' => 'article/<action>',
'article/<slug>' => 'article/view'
],
],