You are here

public function Broken::build in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Block/Plugin/Block/Broken.php \Drupal\Core\Block\Plugin\Block\Broken::build()
  2. 9 core/lib/Drupal/Core/Block/Plugin/Block/Broken.php \Drupal\Core\Block\Plugin\Block\Broken::build()

File

core/lib/Drupal/Core/Block/Plugin/Block/Broken.php, line 67

Class

Broken
Defines a fallback plugin for missing block plugins.

Namespace

Drupal\Core\Block\Plugin\Block

Code

public function build() {
  $build = [];
  if ($this->currentUser
    ->hasPermission('administer blocks')) {
    $build += $this
      ->brokenMessage();
  }
  return $build;
}