You are here

public function BlockUploadBlock::build in Block Upload 8

Build the content for mymodule block.

Overrides BlockPluginInterface::build

File

src/Plugin/Block/BlockUploadBlock.php, line 60

Class

BlockUploadBlock
Provides a Custom block.

Namespace

Drupal\block_upload\Plugin\Block

Code

public function build() {
  if (!$this->account
    ->hasPermission('block upload')) {
    return [];
  }
  $block_id = $this
    ->getDerivativeId();
  return [
    BlockUploadManager::blockUploadBuildBlockContent($block_id),
    '#cache' => [
      'max-age' => 0,
    ],
  ];
}