ExampleUppercaseBlock.php

Same filename and directory in other branches
  1. 4.0.x modules/block_example/src/Plugin/Block/ExampleUppercaseBlock.php

Namespace

Drupal\block_example\Plugin\Block

File

modules/block_example/src/Plugin/Block/ExampleUppercaseBlock.php

View source
<?php

namespace Drupal\block_example\Plugin\Block;

use Drupal\Core\Block\BlockBase;

/**
 * Provides a 'Example: uppercase this please' block.
 *
 * @Block(
 *   id = "example_uppercase",
 *   admin_label = @Translation("Example: uppercase this please")
 * )
 */
class ExampleUppercaseBlock extends BlockBase {
    
    /**
     * {@inheritdoc}
     */
    public function build() {
        return [
            '#markup' => $this->t("This block's title is changed to uppercase. Any block title which contains 'uppercase' will also be changed to uppercase."),
        ];
    }

}

Classes

Title Deprecated Summary
ExampleUppercaseBlock Provides a 'Example: uppercase this please' block.