knplabs/knpbundles — comment on commit e1a4bdb49e4861a541ffd251a6b4a806409048f6
File:  line 0
By stof:

a better solution would be to use ``$parameters['route_params']`` instead of using all parameters and removing some of them as you would have issues with bundles adding extra attributes (SensioFrameworkExtraBundle does for instance). This is exactly why this attribute has been added.

And to create exactly the corresponding url, you should generate it with using ``array_merge($request->attributes->get('_route_params'), $request->query->all())`` as parameters to keep the GET params.