class RouteCallback in Contact Emails 8
Defines dynamic routes.
Hierarchy
- class \Drupal\contact_emails\Routing\RouteCallback
Expanded class hierarchy of RouteCallback
File
- src/
Routing/ RouteCallback.php, line 10
Namespace
Drupal\contact_emails\RoutingView source
class RouteCallback {
/**
* {@inheritdoc}
*/
public function addFormTitle() {
$route_match = \Drupal::routeMatch();
$contact_form = $route_match
->getParameter('contact_form');
return t('Add New Contact Email to "@contact_form"', [
'@contact_form' => $contact_form
->label(),
]);
}
/**
* {@inheritdoc}
*/
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(),
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteCallback:: |
public | function | ||
RouteCallback:: |
public | function |