symfony2 是否可以使用正则表达式为单个 Controller 操作定义多个 url 模式,因此我们不必定义多个规则?
提前致谢
最佳答案
使用注解时,可以定义多个路由。像那样:
/**
* @Route ("item1")
* @Route ("item/2")
* @Method("GET")
*/
public function itemAction() {
}
我使用的是 2.0.9 版
关于url - symfony2 使用正则表达式为单个 Controller 操作使用多个 url 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10438698/