You are here

public function UserFormModeController::pageTitle in Form mode manager 8

The _title_callback for the entity.add routes.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

string $operation: Name of current context operation to display title (create/edit).

Return value

string The page title.

Overrides EntityFormModeBase::pageTitle

2 calls to UserFormModeController::pageTitle()
UserFormModeController::addPageTitle in src/Controller/UserFormModeController.php
The _title_callback for the entity.add routes.
UserFormModeController::editPageTitle in src/Controller/UserFormModeController.php
The _title_callback for the entity.add routes.

File

src/Controller/UserFormModeController.php, line 79

Class

UserFormModeController
Controller for specific User entity form mode support.

Namespace

Drupal\form_mode_manager\Controller

Code

public function pageTitle(RouteMatchInterface $route_match, $operation) {
  $form_mode_label = $route_match
    ->getRouteObject()
    ->getOption('parameters')['form_mode']['label'];
  return $this
    ->t('@op @name as @form_mode_label', [
    '@name' => $this
      ->t('User'),
    '@form_mode_label' => $form_mode_label,
    '@op' => $operation,
  ]);
}