Skip to content

Instantly share code, notes, and snippets.

@mkorostoff
Created October 30, 2014 02:17
Show Gist options
  • Select an option

  • Save mkorostoff/3dfd490c65ace4aba873 to your computer and use it in GitHub Desktop.

Select an option

Save mkorostoff/3dfd490c65ace4aba873 to your computer and use it in GitHub Desktop.
<?php
/**
* @file
* Contains \Drupal\yourmodule\Plugin\Block\YourBlockName.
*/
namespace Drupal\yourmodule\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Provides my custom block.
*
* @Block(
* id = "my_custom_block",
* admin_label = @Translation("My Custom Block"),
* category = @Translation("Blocks")
* )
*/
class YourBlockName extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
return array('#markup' => 'hello world');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment