Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SimplePageVariant.php

function SimplePageVariant::build

Overrides VariantInterface::build

File

core/lib/Drupal/Core/Render/Plugin/DisplayVariant/SimplePageVariant.php, line 52

Class

SimplePageVariant
Provides a page display variant that simply renders the main content.

Namespace

Drupal\Core\Render\Plugin\DisplayVariant

Code

public function build() {
    $build = [
        'content' => [
            'messages' => [
                '#type' => 'status_messages',
                '#weight' => -1000,
                '#include_fallback' => TRUE,
            ],
            'page_title' => [
                '#type' => 'page_title',
                '#title' => $this->title,
                '#weight' => -900,
            ],
            'main_content' => [
                '#weight' => -800,
            ] + $this->mainContent,
        ],
    ];
    return $build;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal