You are here

public function ThunderArticleBreadcrumbBuilder::applies in Thunder 6.2.x

Same name and namespace in other branches
  1. 8.5 modules/thunder_article/src/Breadcrumb/ThunderArticleBreadcrumbBuilder.php \Drupal\thunder_article\Breadcrumb\ThunderArticleBreadcrumbBuilder::applies()
  2. 8.2 modules/thunder_article/src/Breadcrumb/ThunderArticleBreadcrumbBuilder.php \Drupal\thunder_article\Breadcrumb\ThunderArticleBreadcrumbBuilder::applies()
  3. 8.3 modules/thunder_article/src/Breadcrumb/ThunderArticleBreadcrumbBuilder.php \Drupal\thunder_article\Breadcrumb\ThunderArticleBreadcrumbBuilder::applies()
  4. 8.4 modules/thunder_article/src/Breadcrumb/ThunderArticleBreadcrumbBuilder.php \Drupal\thunder_article\Breadcrumb\ThunderArticleBreadcrumbBuilder::applies()
  5. 6.0.x modules/thunder_article/src/Breadcrumb/ThunderArticleBreadcrumbBuilder.php \Drupal\thunder_article\Breadcrumb\ThunderArticleBreadcrumbBuilder::applies()
  6. 6.1.x modules/thunder_article/src/Breadcrumb/ThunderArticleBreadcrumbBuilder.php \Drupal\thunder_article\Breadcrumb\ThunderArticleBreadcrumbBuilder::applies()

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

modules/thunder_article/src/Breadcrumb/ThunderArticleBreadcrumbBuilder.php, line 105

Class

ThunderArticleBreadcrumbBuilder
Class to define the menu_link breadcrumb builder.

Namespace

Drupal\thunder_article\Breadcrumb

Code

public function applies(RouteMatchInterface $route_match) {

  // This breadcrumb apply only for all articles.
  $parameters = $route_match
    ->getParameters()
    ->all();
  if ($route_match
    ->getRouteName() === 'entity.node.canonical' && is_object($parameters['node'])) {
    return $parameters['node']
      ->getType() == 'article';
  }
  return FALSE;
}