NavigationUserBlock.php
Same filename in other branches
Namespace
Drupal\navigation\Plugin\BlockFile
-
core/
modules/ navigation/ src/ Plugin/ Block/ NavigationUserBlock.php
View source
<?php
declare (strict_types=1);
namespace Drupal\navigation\Plugin\Block;
use Drupal\Core\Block\Attribute\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\StringTranslation\TranslatableMarkup;
/**
* Defines a user navigation block.
*
* @internal
*/
final class NavigationUserBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() : array {
return [
'user' => [
'#lazy_builder' => [
'navigation.user_lazy_builder:renderNavigationLinks',
[],
],
'#create_placeholder' => TRUE,
'#cache' => [
'keys' => [
'user_set_navigation_links',
],
'contexts' => [
'user',
],
],
'#lazy_builder_preview' => [
'#markup' => '<a href="#" class="toolbar-tray-lazy-placeholder-link"> </a>',
],
],
];
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
NavigationUserBlock | Defines a user navigation block. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.