The offending question is How to get current route in Symfony 2?
Every Some answer suggests the use of
_route and it works in most cases, really - I personally also use that solution.
Until I found that it isn't work in one case (if the request is forwarded from another controller,
_route is null). I do a google and I find something worse.
As fabpot (Symfony developer) said
You should never rely on the _route. It's only available for debugging purpose.
And I am puzzled of what I should do in this case. I only have 30 rep and cannot comment and such...
And I don't know the "correct" way of solving the question itself.
So I re-read all the answers. Indeed there are better answers that avoid
request.attributes.get('_route') (which I think what fabpot in that github issue talks about) and are (officially) documented in some way.
I don't upvote those because I would like to check myself before doing so, but I don't have Symfony nearby at the moment.
At the moment, it seems that I could treat this case as incorrect answer(s), and I could just go check FAQs for that.
Anyway, at least I know what to do now :) About the rep thing, it just takes time. lol.