0

example case URI: '/department/id/1'

Controller:

/**

     @Route/department/id/{slug}
*/
        function($slug)
        return new Response($slug)

it return me '1'

if I have URI:/department/id/1/category/id/2

how to form the @Route that capture 1 and 2 ?

please help thanks

kristyan
  • 81
  • 10

1 Answers1

1
/**
 @Route(/department/{slug}/category/{id}, name='department_category_detail')
*/
public function departmentCagetegoryDetailAction($slug, $id) {
    ....
}
Mert Öksüz
  • 1,071
  • 6
  • 17