function CommentBreadcrumbBuilder::applies
Overrides BreadcrumbBuilderInterface::applies
File
-
core/
modules/ comment/ src/ CommentBreadcrumbBuilder.php, line 39
Class
- CommentBreadcrumbBuilder
- Class to define the comment breadcrumb builder.
Namespace
Drupal\commentCode
public function applies(RouteMatchInterface $route_match, ?CacheableMetadata $cacheable_metadata = NULL) {
// @todo Remove null safe operator in Drupal 12.0.0, see
// https://www.drupal.org/project/drupal/issues/3459277.
$cacheable_metadata?->addCacheContexts([
'route',
]);
return $route_match->getRouteName() == 'comment.reply' && $route_match->getParameter('entity');
}