[HttpKernel] added a comment to warn about possible inconsistencies

This commit is contained in:
Fabien Potencier 2013-08-22 09:01:15 +02:00
parent c4636e1252
commit 7117328bd7
1 changed files with 5 additions and 1 deletions

View File

@ -46,10 +46,14 @@ abstract class RoutableFragmentRenderer implements FragmentRendererInterface
*/
protected function generateFragmentUri(ControllerReference $reference, Request $request)
{
// We need to forward the current _format and _locale values as we don't have
// a proper routing pattern to do the job for us.
// This makes things inconsistent if you switch from rendering a controller
// to rendering a route if the route pattern does not contain the special
// _format and _locale placeholders.
if (!isset($reference->attributes['_format'])) {
$reference->attributes['_format'] = $request->getRequestFormat();
}
if (!isset($reference->attributes['_locale'])) {
$reference->attributes['_locale'] = $request->getLocale();
}