Skip to content

Instantly share code, notes, and snippets.

@leonrenkema
Created January 19, 2016 18:26
Show Gist options
  • Save leonrenkema/dbbb6eba83647b78caa8 to your computer and use it in GitHub Desktop.
Save leonrenkema/dbbb6eba83647b78caa8 to your computer and use it in GitHub Desktop.
<?php
namespace Drupal\hello\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Class HelloBlock
* @package Drupal\hello\Plugin\Block
*
* @Block(
* id = "leon_hello_block",
* admin_label = @Translation("Leon's hello block"),
* category = @Translation("Leon")
* )
*/
class HelloBlock extends BlockBase {
/**
* Builds and returns the renderable array for this block plugin.
*
* @return array
* A renderable array representing the content of the block.
*
* @see \Drupal\block\BlockViewBuilder
*/
public function build()
{
return array(
'#title' => 'Hello world!',
'#markup' => 'This is the content'
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment