'parent_id' => "field_ui.fields:form_display_overview_
$entity_type_id",
'weight' => -1,
];
$this->derivatives
['field_display_default_' .
$entity_type_id] =
[ 'title' => 'Default',
'route_name' => "entity.entity_view_display.
$entity_type_id.default",
'parent_id' => "field_ui.fields:display_overview_
$entity_type_id",
'weight' => -1,
];
// One local task for each form mode.
$form_modes =
$this->entityDisplayRepository->
getFormModes($entity_type_id);
// Sort all form modes by title.
$form_modes_titles =
array_values(array_map(fn($item) =>
(string) $item['label'
],
$form_modes));
sort($form_modes_titles, SORT_NATURAL
);
foreach ($form_modes as $form_mode =>
$form_mode_info) { $this->derivatives
['field_form_display_' .
$form_mode . '_' .
$entity_type_id] =
[ 'title' =>
$form_mode_info['label'
],
'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",