Skip to content

Instantly share code, notes, and snippets.

@pixiekat
Created June 22, 2018 12:38
Show Gist options
  • Save pixiekat/2b9f234e41f418af7cf727e2850870b9 to your computer and use it in GitHub Desktop.
Save pixiekat/2b9f234e41f418af7cf727e2850870b9 to your computer and use it in GitHub Desktop.
Drupal 8 Useful Snippets
<?php
$definitions = Drupal::service('plugin.manager.field.field_type')->getDefinitions();
foreach ( $definitions as $field_type => $definition) {
print 'Label: '. $definition['label']. PHP_EOL;
print 'Machine name: '. $field_type. PHP_EOL;
print 'Descritpion: '. $definition['description']. PHP_EOL;
print 'Provider: '. $definition['provider']. PHP_EOL . ' ---' . PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment