示例案例URI:' / department / id / 1'
控制器:
/**
@Route/department/id/{slug}
*/
function($slug)
return new Response($slug)
它返回我' 1'
如果我有URI: / department / id / 1 / category / id / 2
如何形成捕获1和2的@Route?
请帮助谢谢
答案 0 :(得分:1)
/**
@Route(/department/{slug}/category/{id}, name='department_category_detail')
*/
public function departmentCagetegoryDetailAction($slug, $id) {
....
}