Builds and returns the renderable array for this block plugin.
array A renderable array representing the content of the block.
Overrides BlockPluginInterface::build
\Drupal\block\BlockRenderController
public function build() {
if ($nodes = node_get_recent($this->configuration['block_count'])) {
return array(
'#theme' => 'node_recent_block',
'#nodes' => $nodes,
);
}
else {
return array(
'#children' => t('No content available.'),
);
}
}