public function TagPluginCollection::getSummary in Extensible BBCode 4.0.x
Same name and namespace in other branches
- 8.3 src/TagPluginCollection.php \Drupal\xbbcode\TagPluginCollection::getSummary()
Generate a list of configured tags for display.
Return value
array A render element.
File
- src/
TagPluginCollection.php, line 89
Class
- TagPluginCollection
- A collection of tag plugins.
Namespace
Drupal\xbbcodeCode
public function getSummary() : array {
$tags = [
'#theme' => 'item_list',
'#context' => [
'list_style' => 'comma-list',
],
'#items' => [],
'#empty' => $this
->t('None'),
'#attached' => [
'library' => [
'xbbcode/filter-tips',
],
],
'#attributes' => [
'class' => [
'xbbcode-filter-tips',
],
],
];
foreach ($this as $name => $tag) {
$tags['#items'][$name] = [
'#type' => 'inline_template',
'#template' => '<abbr title="{{ tag.description }}">[{{ tag.name }}]</abbr>',
'#context' => [
'tag' => $tag,
],
];
}
return $tags;
}