Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2: Splitting routing.yml in multiple files

Tags:

symfony

I have a routing.yml file where I define the routes of my bundle. My routing file is growing bigger.

Is there a way to split the routing.yml file in multiple files? Eg:

  • user_routing.yml
  • vehicles_routing.yml
  • cost_centers_routing.yml

NOTE: I am using Symfony 2.2;

like image 438
Leonel Machava Avatar asked May 03 '13 09:05

Leonel Machava


1 Answers

The routing.yml can split by multiple files. You can include separate routing files in your routing.yml file.

acme_demo_user:
  resource: "@acmeDemoBundle/Resources/config/routing/user_routing.yml"
  prefix: /user
acme_demo_vehicles:
  resource: "@acmeDemoBundle/Resources/config/routing/vehicles_routing.yml"
  prefix: /vehicles
.............
.............
like image 96
Nisam Avatar answered Oct 13 '22 19:10

Nisam