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"),
16 class PageTitleBlock extends BlockBase implements TitleBlockPluginInterface {
19 * The page title: a string (plain title) or a render array (formatted title).
23 protected $title = '';
28 public function setTitle($title) {
29 $this->title = $title;
36 public function defaultConfiguration() {
37 return ['label_display' => FALSE];
43 public function build() {
45 '#type' => 'page_title',
46 '#title' => $this->title,