BlockBase::label

public BlockBase::label()

Returns the user-facing block label.

@todo Provide other specific label-related methods in https://www.drupal.org/node/2025649.

Return value

string The block label.

Overrides BlockPluginInterface::label

File

core/lib/Drupal/Core/Block/BlockBase.php, line 42

Class

BlockBase
Defines a base block implementation that most blocks plugins will extend.

Namespace

Drupal\Core\Block

Code

public function label() {
  if (!empty($this->configuration['label'])) {
    return $this->configuration['label'];
  }

  $definition = $this->getPluginDefinition();
  // Cast the admin label to a string since it is an object.
  // @see \Drupal\Core\StringTranslation\TranslatableMarkup
  return (string) $definition['admin_label'];
}
doc_Drupal
2016-10-29 08:46:36
Comments
Leave a Comment

Please login to continue.