在配置中添加了以下规则:
当我访问http://localhost/area/country?countryId=106&countryName=thailand
,url
应该是http://localhost/thailand-106
, 这个是没问题的。
但是,在这个页面中有分页的按钮,现在分页的url就成了这样(下图第一个):
现在我想改成上图的第二个的形式,应该怎么做呢?
在配置中添加了以下规则:
当我访问http://localhost/area/country?countryId=106&countryName=thailand
,url
应该是http://localhost/thailand-106
, 这个是没问题的。
但是,在这个页面中有分页的按钮,现在分页的url就成了这样(下图第一个):
现在我想改成上图的第二个的形式,应该怎么做呢?
再加多一条规则即可。当第一条不匹配的时候,会继续匹配下一条。
'rules' => [
....
"<countryUrlName:\w+>-<countryId:\w+>"=>"area/country",
"<countryUrlName:\w+>-<countryId:\w+>/<page:\w+>.html"=>"area/country",
],
1 回答4k 阅读✓ 已解决
3 回答1.8k 阅读✓ 已解决
2 回答2.2k 阅读✓ 已解决
1 回答1.3k 阅读✓ 已解决
2 回答2.2k 阅读
1 回答523 阅读✓ 已解决
772 阅读
pattern里把page也加进去