You are here

public function RawPathComponent::getTitle in Breadcrumb Manager 8

Get title.

Parameters

string $path: The path.

\Symfony\Component\HttpFoundation\Request $request: The Request.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The Route match.

Return value

string The resolved title.

Overrides BreadcrumbTitleResolverInterface::getTitle

File

src/Plugin/BreadcrumbTitleResolver/RawPathComponent.php, line 27

Class

RawPathComponent
Class RawPathComponent.

Namespace

Drupal\breadcrumb_manager\Plugin\BreadcrumbTitleResolver

Code

public function getTitle($path, Request $request, RouteMatchInterface $route_match) {
  $path_elements = explode('/', $path);
  $element = end($path_elements);
  return str_replace([
    '-',
    '_',
  ], ' ', Unicode::ucfirst($element));
}