You are here

class SystemMainBlock in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/src/Plugin/Block/SystemMainBlock.php \Drupal\system\Plugin\Block\SystemMainBlock
  2. 9 core/modules/system/src/Plugin/Block/SystemMainBlock.php \Drupal\system\Plugin\Block\SystemMainBlock

Provides a 'Main page content' block.

Plugin annotation


@Block(
  id = "system_main_block",
  admin_label = @Translation("Main page content"),
  forms = {
    "settings_tray" = FALSE,
  },
)

Hierarchy

Expanded class hierarchy of SystemMainBlock

File

core/modules/system/src/Plugin/Block/SystemMainBlock.php, line 19

Namespace

Drupal\system\Plugin\Block
View source
class SystemMainBlock extends BlockBase implements MainContentBlockPluginInterface {

  /**
   * The render array representing the main page content.
   *
   * @var array
   */
  protected $mainContent;

  /**
   * {@inheritdoc}
   */
  public function setMainContent(array $main_content) {
    $this->mainContent = $main_content;
  }

  /**
   * {@inheritdoc}
   */
  public function build() {
    return $this->mainContent;
  }

}

Members