[英]how to route all sub requests to one action in yii2 framework
I want to catch all urls in one action like:我想在一个动作中捕获所有网址,例如:
* http://my-domain.com/controller/myaction/test
* http://my-domain.com/controller/myaction/test2
* http://my-domain.com/controller/myaction/other_url
can I get it on "myaction"?我可以在“myaction”上得到它吗?
Try this something like this试试这样
'<controller:[\w\-]+>/<action:[\w\-]+>/<ident:\d+>/<token:\w+>/<module:\w+>' => '<controller>/<action>' // 2
above will take/create urls like以上将采用/创建网址,例如
localhost/frontend/web/site/test-router/10/ADB/P120
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.