You are here

public function ThunderPoweredByBlock::build in Thunder 8.4

Same name and namespace in other branches
  1. 8.5 src/Plugin/Block/ThunderPoweredByBlock.php \Drupal\thunder\Plugin\Block\ThunderPoweredByBlock::build()
  2. 8.2 src/Plugin/Block/ThunderPoweredByBlock.php \Drupal\thunder\Plugin\Block\ThunderPoweredByBlock::build()
  3. 8.3 src/Plugin/Block/ThunderPoweredByBlock.php \Drupal\thunder\Plugin\Block\ThunderPoweredByBlock::build()
  4. 6.2.x src/Plugin/Block/ThunderPoweredByBlock.php \Drupal\thunder\Plugin\Block\ThunderPoweredByBlock::build()
  5. 6.0.x src/Plugin/Block/ThunderPoweredByBlock.php \Drupal\thunder\Plugin\Block\ThunderPoweredByBlock::build()
  6. 6.1.x src/Plugin/Block/ThunderPoweredByBlock.php \Drupal\thunder\Plugin\Block\ThunderPoweredByBlock::build()

Builds and returns the renderable array for this block plugin.

If a block should not be rendered because it has no content, then this method must also ensure to return no content: it must then only return an empty array, or an empty array with #cache set (with cacheability metadata indicating the circumstances for it being empty).

Return value

array A renderable array representing the content of the block.

Overrides BlockPluginInterface::build

See also

\Drupal\block\BlockViewBuilder

File

src/Plugin/Block/ThunderPoweredByBlock.php, line 27

Class

ThunderPoweredByBlock
Provides a 'Powered by Thunder' block.

Namespace

Drupal\thunder\Plugin\Block

Code

public function build() {
  return [
    '#markup' => '<span>' . $this
      ->t('Powered by <a href=":poweredby">Thunder</a>', [
      ':poweredby' => 'http://www.thunder.org',
    ]) . '</span>',
  ];
}