benoliver999
benoliver999

Reputation: 165

Routes ignored when referencing external resource as a directory

I'm trying to have a directory src/Vendor/Bundle/Resources/config/routes/ be full of routing files (in yml). I have this:

# /src/Vendor/Bundle/Resources/config/routing.yml
route1:
    resource: "@VendorBundle/Resources/config/routes/"

But the routes don't get picked up and are not listed when I run the router debug in the console.

They do work when I reference them one by one:

# /src/Vendor/Bundle/Resources/config/routing.yml
route1:
    resource: "@VendorBundle/Resources/config/routes/myroute.yml"

The docs state this should work but I can't get it to.

So far:

Any ideas or advice would be very helpful.

Upvotes: 1

Views: 71

Answers (1)

benoliver999
benoliver999

Reputation: 165

Cerad answered the question:

The link is perhaps not as clear as it should be but the directory approach is for route annotations defined inside of controllers. You will need to include your route files one at a time.

Upvotes: 1

Related Questions