Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Drupalmodule_namePluginBlock;
- use DrupalblockBlockBase;
- use DrupalCoreSessionAccountInterface;
- /**
- * Provides a 'Demo' block.
- *
- * @Block(
- * id = "demo_block",
- * admin_label = @Translation("Demo block"),
- * )
- */
- class MyCustomblockName extends BlockBase {
- /**
- * {@inheritdoc}
- */
- public function build() {
- return array(
- '#markup' => $this->t('Hello World!'),
- );
- }
- /**
- * {@inheritdoc}
- */
- public function access(AccountInterface $account) {
- return $account->hasPermission('access content');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement