public function VarbaseQuickLinks::build in Varbase Total Control Dashboard 8.6
Same name and namespace in other branches
- 8 src/Plugin/Block/VarbaseQuickLinks.php \Drupal\varbase_total_control\Plugin\Block\VarbaseQuickLinks::build()
- 8.5 src/Plugin/Block/VarbaseQuickLinks.php \Drupal\varbase_total_control\Plugin\Block\VarbaseQuickLinks::build()
- 9.0.x src/Plugin/Block/VarbaseQuickLinks.php \Drupal\varbase_total_control\Plugin\Block\VarbaseQuickLinks::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/ VarbaseQuickLinks.php, line 63
Class
- VarbaseQuickLinks
- Provides a 'Varbase Quick Links'.
Namespace
Drupal\varbase_total_control\Plugin\BlockCode
public function build() {
$links = [];
$links[] = Link::fromTextAndUrl($this
->t('Manage menus'), new Url('entity.menu.collection'));
$links[] = Link::fromTextAndUrl($this
->t('Manage taxonomy'), new Url('entity.taxonomy_vocabulary.collection'));
$links[] = Link::fromTextAndUrl($this
->t('Manage users'), new Url('entity.user.collection'));
$body_data = [
'#theme' => 'item_list',
'#list_type' => 'ul',
'#items' => $links,
];
$markup_data = $this->renderer
->render($body_data);
return [
'#type' => 'markup',
'#markup' => $markup_data,
];
}