[HttpKernel] added a comment to warn about possible inconsistencies
This commit is contained in:
parent
c4636e1252
commit
7117328bd7
@ -46,10 +46,14 @@ abstract class RoutableFragmentRenderer implements FragmentRendererInterface
|
|||||||
*/
|
*/
|
||||||
protected function generateFragmentUri(ControllerReference $reference, Request $request)
|
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'])) {
|
if (!isset($reference->attributes['_format'])) {
|
||||||
$reference->attributes['_format'] = $request->getRequestFormat();
|
$reference->attributes['_format'] = $request->getRequestFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($reference->attributes['_locale'])) {
|
if (!isset($reference->attributes['_locale'])) {
|
||||||
$reference->attributes['_locale'] = $request->getLocale();
|
$reference->attributes['_locale'] = $request->getLocale();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user