You are here

protected function CurrencyRouteProvider::getAddFormRoute in Commerce Core 8.2

Gets the add-form route.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.

Return value

\Symfony\Component\Routing\Route|null The generated route, if available.

Overrides DefaultHtmlRouteProvider::getAddFormRoute

File

modules/price/src/CurrencyRouteProvider.php, line 16

Class

CurrencyRouteProvider
Provides routes for the Currency entity.

Namespace

Drupal\commerce_price

Code

protected function getAddFormRoute(EntityTypeInterface $entity_type) {
  $route = parent::getAddFormRoute($entity_type);

  // Replace the "Add currency" title with "Add custom currency".
  // The t() function is used to ensure the string is picked up for
  // translation, even though _title is supposed to be untranslated.
  $route
    ->setDefault('_title_callback', '');
  $route
    ->setDefault('_title', t('Add custom currency')
    ->getUntranslatedString());
  return $route;
}