It's never a good idea to hardcode pathinfo check... You should really get the current route name instead (it's in the `_route` request attribute)