'route_name' => "entity.entity_form_display.
$entity_type_id.form_mode",
'route_parameters' =>
[ 'form_mode_name' =>
$form_mode,
],
'parent_id' => "field_ui.fields:form_display_overview_
$entity_type_id",
'weight' =>
array_flip($form_modes_titles)[(string) $form_mode_info['label'
]],
'cache_tags' =>
$this->entityTypeManager->
getDefinition('entity_form_display'
)->
getListCacheTags(),
];
} // One local task for each view mode.
$view_modes =
$this->entityDisplayRepository->
getViewModes($entity_type_id);
// Sort all view modes by title.
$view_modes_titles =
array_values(array_map(fn($item) =>
(string) $item['label'
],
$view_modes));
sort($view_modes_titles, SORT_NATURAL
);
foreach ($view_modes as $view_mode =>
$form_mode_info) { $this->derivatives
['field_display_' .
$view_mode . '_' .
$entity_type_id] =
[ 'title' =>
$form_mode_info['label'
],
'route_name' => "entity.entity_view_display.
$entity_type_id.view_mode",
'route_parameters' =>
[ 'view_mode_name' =>
$view_mode,
],
'parent_id' => "field_ui.fields:display_overview_
$entity_type_id",