Guest User

Untitled

a guest
Jul 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. $types = Drupal::entityTypeManager()
  2. ->getStorage('node_type')
  3. ->loadMultiple();
  4.  
  5. $node_types = DrupalnodeEntityNodeType::loadMultiple();
  6. // If you need to display them in a drop down:
  7. $options = [];
  8. foreach ($node_types as $node_type) {
  9. $options[$node_type->id()] = $node_type->label();
  10. }
Add Comment
Please, Sign In to add comment