3 namespace Drupal\Core\Block\Plugin\Block;
5 use Drupal\Core\Block\BlockBase;
6 use Drupal\Core\Block\TitleBlockPluginInterface;
9 * Provides a block to display the page title.
12 * id = "page_title_block",
13 * admin_label = @Translation("Page title"),
15 * "settings_tray" = FALSE,
19 class PageTitleBlock extends BlockBase implements TitleBlockPluginInterface {
22 * The page title: a string (plain title) or a render array (formatted title).
26 protected $title = '';
31 public function setTitle($title) {
32 $this->title = $title;
39 public function defaultConfiguration() {
40 return ['label_display' => FALSE];
46 public function build() {
48 '#type' => 'page_title',
49 '#title' => $this->title,