Advertisement
Guest User

Untitled

a guest
May 5th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. namespace Drupalmodule_namePluginBlock;
  2.  
  3. use DrupalblockBlockBase;
  4. use DrupalCoreSessionAccountInterface;
  5.  
  6. /**
  7. * Provides a 'Demo' block.
  8. *
  9. * @Block(
  10. * id = "demo_block",
  11. * admin_label = @Translation("Demo block"),
  12. * )
  13. */
  14.  
  15. class MyCustomblockName extends BlockBase {
  16.  
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function build() {
  21. return array(
  22. '#markup' => $this->t('Hello World!'),
  23. );
  24. }
  25.  
  26. /**
  27. * {@inheritdoc}
  28. */
  29.  
  30. public function access(AccountInterface $account) {
  31. return $account->hasPermission('access content');
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement