nnikolay
nnikolay

Reputation: 1751

Dynamic routing catch all with symfony2

I have my own routing system I would like to send each call to one controller and in the controller I will detect which route/content I will display.

How to write this in the routing.yml so I can send each call to one controller?

Thanks!

Upvotes: 0

Views: 581

Answers (1)

qooplmao
qooplmao

Reputation: 17759

I think you could do it with a catch all route like

catch_all:
    path: /{catch_all}
    defaults:
        _controller: Your:Controller:AndAction
    requirements:
        catch_all: "[\s\S]+"

That should catch all paths and pass them into your controller as the "catch_all" parameter, from there you could do what ever you want with it.

Upvotes: 2

Related Questions