private function ContentItemBlock::getContentTypes in Panopoly 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 modules/
panopoly/ panopoly_widgets/ src/ Plugin/ Block/ ContentItemBlock.php
File
- modules/
panopoly/ panopoly_widgets/ 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;
}