class PageTitleBlock
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Block/Plugin/Block/PageTitleBlock.php \Drupal\Core\Block\Plugin\Block\PageTitleBlock
- 10 core/lib/Drupal/Core/Block/Plugin/Block/PageTitleBlock.php \Drupal\Core\Block\Plugin\Block\PageTitleBlock
- 9 core/lib/Drupal/Core/Block/Plugin/Block/PageTitleBlock.php \Drupal\Core\Block\Plugin\Block\PageTitleBlock
Provides a block to display the page title.
Plugin annotation
@Block(
id = "page_title_block",
admin_label = @Translation("Page title"),
forms = {
"settings_tray" = FALSE,
},
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Component\Plugin\ContextAwarePluginBase implements \Drupal\Component\Plugin\ContextAwarePluginInterface extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\Core\Plugin\ContextAwarePluginBase implements \Drupal\Core\Plugin\ContextAwarePluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\TypedData\TypedDataTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait extends \Drupal\Component\Plugin\ContextAwarePluginBase
- class \Drupal\Core\Block\BlockBase implements \Drupal\Core\Block\BlockPluginInterface, \Drupal\Core\Plugin\PluginWithFormsInterface, \Drupal\Core\Render\PreviewFallbackInterface uses \Drupal\Core\Block\BlockPluginTrait, \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait extends \Drupal\Core\Plugin\ContextAwarePluginBase
- class \Drupal\Core\Block\Plugin\Block\PageTitleBlock implements \Drupal\Core\Block\TitleBlockPluginInterface extends \Drupal\Core\Block\BlockBase
- class \Drupal\Core\Block\BlockBase implements \Drupal\Core\Block\BlockPluginInterface, \Drupal\Core\Plugin\PluginWithFormsInterface, \Drupal\Core\Render\PreviewFallbackInterface uses \Drupal\Core\Block\BlockPluginTrait, \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait extends \Drupal\Core\Plugin\ContextAwarePluginBase
- class \Drupal\Core\Plugin\ContextAwarePluginBase implements \Drupal\Core\Plugin\ContextAwarePluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\TypedData\TypedDataTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait extends \Drupal\Component\Plugin\ContextAwarePluginBase
- class \Drupal\Component\Plugin\ContextAwarePluginBase implements \Drupal\Component\Plugin\ContextAwarePluginInterface extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of PageTitleBlock
File
-
core/
lib/ Drupal/ Core/ Block/ Plugin/ Block/ PageTitleBlock.php, line 19
Namespace
Drupal\Core\Block\Plugin\BlockView source
class PageTitleBlock extends BlockBase implements TitleBlockPluginInterface {
/**
* The page title: a string (plain title) or a render array (formatted title).
*
* @var string|array
*/
protected $title = '';
/**
* {@inheritdoc}
*/
public function setTitle($title) {
$this->title = $title;
return $this;
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [
'label_display' => FALSE,
];
}
/**
* {@inheritdoc}
*/
public function build() {
return [
'#type' => 'page_title',
'#title' => $this->title,
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.