public function TrumbaOpenSpudBlock::build in Trumba 8
Same name and namespace in other branches
- 2.x src/Plugin/Block/TrumbaOpenSpudBlock.php \Drupal\trumba\Plugin\Block\TrumbaOpenSpudBlock::build()
Builds and returns the renderable array for this block plugin.
If a block should not be rendered because it has no content, then this method must also ensure to return no content: it must then only return an empty array, or an empty array with #cache set (with cacheability metadata indicating the circumstances for it being empty).
Return value
array A renderable array representing the content of the block.
Overrides BlockPluginInterface::build
See also
\Drupal\block\BlockViewBuilder
File
- src/
Plugin/ Block/ TrumbaOpenSpudBlock.php, line 60
Class
- TrumbaOpenSpudBlock
- Provides a 'TrumbaOpenSpudBlock' block.
Namespace
Drupal\trumba\Plugin\BlockCode
public function build() {
$params = [
'spudId' => $this->spudId,
'webName' => $this->configuration['trumba_web_name'],
'teaserBase' => $this
->convertUriToAbsolutePathOrUrl($this->configuration['trumba_spud_url']),
'spudType' => $this->configuration['trumba_open_spud_spud_type'],
'spudConfig' => $this->configuration['trumba_open_spud_spud_configuration'],
];
$cache_spud_id = str_ireplace('_', '-', $this
->getPluginId());
return _trumba_spud_embed($this->spudId, $params, $cache_spud_id);
}