You are here

public function TMGMTLocalBreadcrumbBuilder::applies in Translation Management Tool 8

Whether this breadcrumb builder should be used to build the breadcrumb.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

Return value

bool TRUE if this builder should be used or FALSE to let other builders decide.

Overrides BreadcrumbBuilderInterface::applies

File

translators/tmgmt_local/src/Menu/TMGMTLocalBreadcrumbBuilder.php, line 22

Class

TMGMTLocalBreadcrumbBuilder
A custom Local task item breadcrumb builder.

Namespace

Drupal\tmgmt_local\Menu

Code

public function applies(RouteMatchInterface $route_match) {
  if (strpos($route_match
    ->getRouteName(), 'view.tmgmt_local_manage_translate_task') === 0 || strpos($route_match
    ->getRouteName(), 'view.tmgmt_local_task_overview') === 0 || $route_match
    ->getParameter('tmgmt_local_task') instanceof LocalTaskInterface || $route_match
    ->getParameter('tmgmt_local_task_item') instanceof LocalTaskItemInterface) {
    return TRUE;
  }
  return FALSE;
}