You are here

public function EasyBreadcrumbBuilder::applyTitleReplacement in Easy Breadcrumb 8

Same name and namespace in other branches
  1. 2.x src/EasyBreadcrumbBuilder.php \Drupal\easy_breadcrumb\EasyBreadcrumbBuilder::applyTitleReplacement()

Apply title replacements.

Parameters

string $title: Page title.

array $replacements: Replacement rules map.

2 calls to EasyBreadcrumbBuilder::applyTitleReplacement()
EasyBreadcrumbBuilder::build in src/EasyBreadcrumbBuilder.php
Builds the breadcrumb.
EasyBreadcrumbBuilder::getTitleString in src/EasyBreadcrumbBuilder.php
Get string title for route.

File

src/EasyBreadcrumbBuilder.php, line 661

Class

EasyBreadcrumbBuilder
Primary implementation for the Easy Breadcrumb builder.

Namespace

Drupal\easy_breadcrumb

Code

public function applyTitleReplacement(&$title, array $replacements) {
  if (!is_string($title)) {
    return;
  }
  if (array_key_exists($title, $replacements)) {
    $title = $replacements[$title];
  }
}