Leonel Machava
Leonel Machava

Reputation: 1531

Symfony2: Splitting routing.yml in multiple files

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:

NOTE: I am using Symfony 2.2;

Upvotes: 6

Views: 5302

Answers (1)

Nisam
Nisam

Reputation: 2285

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
.............
.............

Upvotes: 18

Related Questions