public function BlockPluginTrait::label in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Block/BlockPluginTrait.php \Drupal\Core\Block\BlockPluginTrait::label()
- 9 core/lib/Drupal/Core/Block/BlockPluginTrait.php \Drupal\Core\Block\BlockPluginTrait::label()
File
- core/
lib/ Drupal/ Core/ Block/ BlockPluginTrait.php, line 50
Class
- BlockPluginTrait
- Provides the base implementation of a block plugin.
Namespace
Drupal\Core\BlockCode
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'];
}