cybtow
cybtow

Reputation: 157

Silex 2: Get route in before middleware

I have defined a before middleware in my Silex 2.0 application, and I would like to know what route is being processed.

For instance:

If I am loading the URL /hello/foo, I want obtain the string /hello/foo in some variable from my before middleware.

If I am loading the URL /en/hello/foo, I want obtain the string /en/hello/foo in some variable from my before middleware.

Upvotes: 1

Views: 364

Answers (1)

Sylwit
Sylwit

Reputation: 1577

$request->getPathInfo() should work

Upvotes: 3

Related Questions