Felurian Felurian - 1 year ago 161
YAML Question

Symfony3: 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 in Symfony3 ?

I saw this question but it is for Symfony2. The path aren't the same.

In Symfony2, we did like this :

resource: "@AppBundle/Resources/config/routing/routing_catalog.yml"
prefix: /catalogs

I tried this but it doesn't work (my file is in the same level than routing.yml) :

resource: "app/config/routing_catalog.yml"
prefix: /catalogs

Answer Source

(When not importing from a bundle), you should use paths relative to the current directory of the configuration file, so for example:

    resource: routing_catalog.yml
    prefix: /catalogs
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download