class HelpSection

Same name in this branch
  1. 10 core/modules/help/src/Annotation/HelpSection.php \Drupal\help\Annotation\HelpSection
Same name and namespace in other branches
  1. 9 core/modules/help/src/Annotation/HelpSection.php \Drupal\help\Annotation\HelpSection
  2. 8.9.x core/modules/help/src/Annotation/HelpSection.php \Drupal\help\Annotation\HelpSection
  3. 11.x core/modules/help/src/Attribute/HelpSection.php \Drupal\help\Attribute\HelpSection
  4. 11.x core/modules/help/src/Annotation/HelpSection.php \Drupal\help\Annotation\HelpSection

Defines a HelpSection attribute object for plugin discovery.

Plugin Namespace: Plugin\HelpSection

For a working example, see \Drupal\help\Plugin\HelpSection\HookHelpSection.

Hierarchy

  • class \Drupal\help\Attribute\HelpSection implements \Drupal\Component\Plugin\Attribute\Plugin

Expanded class hierarchy of HelpSection

See also

\Drupal\help\HelpSectionPluginInterface

\Drupal\help\Plugin\HelpSection\HelpSectionPluginBase

\Drupal\help\HelpSectionManager

hook_help_section_info_alter()

Plugin API

5 files declare their use of HelpSection
EmptyHelpSection.php in core/modules/help/tests/modules/help_page_test/src/Plugin/HelpSection/EmptyHelpSection.php
HelpSectionManager.php in core/modules/help/src/HelpSectionManager.php
HelpTopicSection.php in core/modules/help/src/Plugin/HelpSection/HelpTopicSection.php
HookHelpSection.php in core/modules/help/src/Plugin/HelpSection/HookHelpSection.php
TestHelpSection.php in core/modules/help/tests/modules/help_topics_test/src/Plugin/HelpSection/TestHelpSection.php

File

core/modules/help/src/Attribute/HelpSection.php, line 23

Namespace

Drupal\help\Attribute
View source
class HelpSection extends Plugin {
  
  /**
   * Constructs a HelpSection attribute.
   *
   * @param string $id
   *   The plugin ID.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $title
   *   The text to use as the title of the help page section.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
   *   (optional) The description of the help page section.
   * @param string|null $permission
   *   (optional) The permission required to access the help page section.
   *
   *   Only set if this section needs its own permission, beyond the generic
   *   'access help pages' permission needed to see the /admin/help
   *   page itself.
   * @param int|null $weight
   *   (optional) The weight of the help page section.
   * @param class-string|null $deriver
   *   (optional) The deriver class.
   *
   *   The sections will be ordered by this weight on the help page.
   */
  public function __construct(public readonly string $id, public readonly TranslatableMarkup $title, public readonly ?TranslatableMarkup $description = NULL, public readonly ?string $permission = NULL, public readonly ?int $weight = NULL, public readonly ?string $deriver = NULL) {
  }

}

Members

Title Sort descending Modifiers Object type Summary
HelpSection::__construct public function Constructs a HelpSection attribute.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.