You are here

public function RouteCallback::editFormTitle in Contact Emails 8

File

src/Routing/RouteCallback.php, line 26

Class

RouteCallback
Defines dynamic routes.

Namespace

Drupal\contact_emails\Routing

Code

public function editFormTitle() {
  $route_match = \Drupal::routeMatch();
  $contact_email = $route_match
    ->getParameter('contact_email');
  $contact_form_id = $contact_email
    ->get('contact_form')->target_id;
  $contact_form = ContactForm::load($contact_form_id);
  return t('Edit Contact Email @id for "@contact_form"', [
    '@id' => $contact_email
      ->id(),
    '@contact_form' => $contact_form
      ->label(),
  ]);
}