class PageTitleBlock
Same name in other branches
- 9 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
- 11.x 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 extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\ContextAwarePluginInterface
- class \Drupal\Core\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\ContextAwarePluginBase implements \Drupal\Core\Plugin\ContextAwarePluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\TypedData\TypedDataTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Core\Block\BlockBase extends \Drupal\Core\Plugin\ContextAwarePluginBase implements \Drupal\Core\Block\BlockPluginInterface, \Drupal\Core\Plugin\PluginWithFormsInterface, \Drupal\Core\Render\PreviewFallbackInterface uses \Drupal\Core\Block\BlockPluginTrait, \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait
- class \Drupal\Core\Block\Plugin\Block\PageTitleBlock extends \Drupal\Core\Block\BlockBase implements \Drupal\Core\Block\TitleBlockPluginInterface
- class \Drupal\Core\Block\BlockBase extends \Drupal\Core\Plugin\ContextAwarePluginBase implements \Drupal\Core\Block\BlockPluginInterface, \Drupal\Core\Plugin\PluginWithFormsInterface, \Drupal\Core\Render\PreviewFallbackInterface uses \Drupal\Core\Block\BlockPluginTrait, \Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait
- class \Drupal\Core\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\ContextAwarePluginBase implements \Drupal\Core\Plugin\ContextAwarePluginInterface, \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\TypedData\TypedDataTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
- class \Drupal\Component\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\ContextAwarePluginInterface
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,
];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
BlockPluginInterface::access | public | function | Indicates whether the block should be shown. | ||
BlockPluginInterface::blockForm | public | function | Returns the configuration form elements specific to this block plugin. | ||
BlockPluginInterface::blockSubmit | public | function | Adds block type-specific submission handling for the block form. | ||
BlockPluginInterface::blockValidate | public | function | Adds block type-specific validation for the block form. | ||
BlockPluginInterface::BLOCK_LABEL_VISIBLE | constant | Indicates the block label (title) should be displayed to end users. | |||
BlockPluginInterface::getMachineNameSuggestion | public | function | Suggests a machine name to identify an instance of this block. | ||
BlockPluginInterface::label | public | function | Returns the user-facing block label. | ||
BlockPluginInterface::setConfigurationValue | public | function | Sets a particular value in the block settings. | ||
CacheableDependencyInterface::getCacheContexts | public | function | The cache contexts associated with this object. | 34 | |
CacheableDependencyInterface::getCacheMaxAge | public | function | The maximum age for which this object may be cached. | 34 | |
CacheableDependencyInterface::getCacheTags | public | function | The cache tags associated with this object. | 27 | |
ConfigurableInterface::getConfiguration | public | function | Gets this plugin's configuration. | 14 | |
ConfigurableInterface::setConfiguration | public | function | Sets the configuration for this plugin instance. | 14 | |
DependentPluginInterface::calculateDependencies | public | function | Calculates dependencies for the configured plugin. | 21 | |
DerivativeInspectionInterface::getBaseId | public | function | Gets the base_plugin_id of the plugin instance. | 1 | |
DerivativeInspectionInterface::getDerivativeId | public | function | Gets the derivative_id of the plugin instance. | 1 | |
PageTitleBlock::$title | protected | property | The page title: a string (plain title) or a render array (formatted title). | ||
PageTitleBlock::build | public | function | Builds and returns the renderable array for this block plugin. | Overrides BlockPluginInterface::build | |
PageTitleBlock::defaultConfiguration | public | function | Gets default configuration for this plugin. | Overrides ConfigurableInterface::defaultConfiguration | |
PageTitleBlock::setTitle | public | function | Sets the title. | Overrides TitleBlockPluginInterface::setTitle | |
PluginFormInterface::buildConfigurationForm | public | function | Form constructor. | 32 | |
PluginFormInterface::submitConfigurationForm | public | function | Form submission handler. | 31 | |
PluginFormInterface::validateConfigurationForm | public | function | Form validation handler. | 17 | |
PluginInspectionInterface::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | 6 | |
PluginInspectionInterface::getPluginId | public | function | Gets the plugin_id of the plugin instance. | 2 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.