You are here

public function FormModesSubscriber::getListRouteTitle in Form mode manager 8.2

Format the title for `add_list` routes.

Parameters

string $form_mode_label: The label of current DisplayForm entity.

Return value

string The translated title string of `add_list` operation routes.

1 call to FormModesSubscriber::getListRouteTitle()
FormModesSubscriber::getFormModeListPageRoute in src/Routing/EventSubscriber/FormModesSubscriber.php
Generate routes to use `add-list` entity operation per form modes.

File

src/Routing/EventSubscriber/FormModesSubscriber.php, line 385

Class

FormModesSubscriber
Listens to the dynamic route event and add routes using form modes.

Namespace

Drupal\form_mode_manager\Routing\EventSubscriber

Code

public function getListRouteTitle($form_mode_label) {
  $translatable_markup = $this
    ->t('Add @entity_type as @form_mode_label', [
    '@entity_type' => $this->entityDefinition
      ->getLabel(),
    '@form_mode_label' => $form_mode_label,
  ]);
  return $translatable_markup
    ->render();
}