class AtToolLazyBuilders in AT Tool 2.0 1.0.x
Lazy builders for the at_tool.
Hierarchy
- class \Drupal\at_tool\AtToolLazyBuilders implements TrustedCallbackInterface
Expanded class hierarchy of AtToolLazyBuilders
1 string reference to 'AtToolLazyBuilders'
1 service uses AtToolLazyBuilders
File
- src/
AtToolLazyBuilders.php, line 13
Namespace
Drupal\at_toolView source
class AtToolLazyBuilders implements TrustedCallbackInterface {
/**
* The request stack.
*
* @var \Symfony\Component\HttpFoundation\RequestStack
*/
protected $requestStack;
/**
* The route match.
*
* @var \Drupal\Core\Routing\RouteMatchInterface
*/
protected $routeMatch;
/**
* The title resolver.
*
* @var \Drupal\Core\Controller\TitleResolverInterface
*/
protected $titleResolver;
/**
* Constructs a new LazyBuilders object.
*
* @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
* The request stack.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The current route match.
* @param \Drupal\Core\Controller\TitleResolverInterface $title_resolver
* The title resolver.
*/
public function __construct(RequestStack $request_stack, RouteMatchInterface $route_match, TitleResolverInterface $title_resolver) {
$this->requestStack = $request_stack;
$this->routeMatch = $route_match;
$this->titleResolver = $title_resolver;
}
/**
* Return values for the breadcrumb title placeholder.
*
* @return array
* A renderable array of breadcrumb title.
*/
public function breadcrumbTitle() {
$request = $this->requestStack
->getCurrentRequest();
$route = $this->routeMatch
->getRouteObject();
$title = $this->titleResolver
->getTitle($request, $route);
$array = [
'#theme' => 'page_title__breadcrumb',
'#title' => $title,
];
return $array;
}
/**
* {@inheritdoc}
*/
public static function trustedCallbacks() {
return [
'breadcrumbTitle',
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AtToolLazyBuilders:: |
protected | property | The request stack. | |
AtToolLazyBuilders:: |
protected | property | The route match. | |
AtToolLazyBuilders:: |
protected | property | The title resolver. | |
AtToolLazyBuilders:: |
public | function | Return values for the breadcrumb title placeholder. | |
AtToolLazyBuilders:: |
public static | function |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
|
AtToolLazyBuilders:: |
public | function | Constructs a new LazyBuilders object. | |
TrustedCallbackInterface:: |
constant | Untrusted callbacks throw exceptions. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger E_USER_WARNING errors. |