class ShortcutsBlock in Drupal 10
Same name and namespace in other branches
- 8 core/modules/shortcut/src/Plugin/Block/ShortcutsBlock.php \Drupal\shortcut\Plugin\Block\ShortcutsBlock
- 9 core/modules/shortcut/src/Plugin/Block/ShortcutsBlock.php \Drupal\shortcut\Plugin\Block\ShortcutsBlock
Provides a 'Shortcut' block.
Plugin annotation
@Block(
id = "shortcuts",
admin_label = @Translation("Shortcuts"),
category = @Translation("Menus")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\Core\Block\BlockBase implements BlockPluginInterface, ContextAwarePluginInterface, PluginWithFormsInterface, PreviewAwarePluginInterface, PreviewFallbackInterface uses BlockPluginTrait, ContextAwarePluginAssignmentTrait, ContextAwarePluginTrait
- class \Drupal\shortcut\Plugin\Block\ShortcutsBlock
- class \Drupal\Core\Block\BlockBase implements BlockPluginInterface, ContextAwarePluginInterface, PluginWithFormsInterface, PreviewAwarePluginInterface, PreviewFallbackInterface uses BlockPluginTrait, ContextAwarePluginAssignmentTrait, ContextAwarePluginTrait
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of ShortcutsBlock
File
- core/
modules/ shortcut/ src/ Plugin/ Block/ ShortcutsBlock.php, line 18
Namespace
Drupal\shortcut\Plugin\BlockView source
class ShortcutsBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return [
shortcut_renderable_links(shortcut_current_displayed_set()),
];
}
/**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'access shortcuts');
}
}