private function ContentItemBlock::getContentTypes in Panopoly Widgets 8.2
Gets content type options.
Return value
array An associative array of content types, with the machine names as the keys and human-readable names as the values.
1 call to ContentItemBlock::getContentTypes()
- ContentItemBlock::blockForm in src/
Plugin/ Block/ ContentItemBlock.php
File
- src/
Plugin/ Block/ ContentItemBlock.php, line 170
Class
- ContentItemBlock
- Block that displays a node.
Namespace
Drupal\panopoly_widgets\Plugin\BlockCode
private function getContentTypes() {
$node_types = NodeType::loadMultiple();
$options = [];
foreach ($node_types as $node_type) {
$options[$node_type
->id()] = $node_type
->label();
}
return $options;
}