Skip to content

Instantly share code, notes, and snippets.

View pixiekat's full-sized avatar
✈️
Dreaming of Scotland

Katie pixiekat

✈️
Dreaming of Scotland
View GitHub Profile
@pixiekat
pixiekat / get_all_field_types.php
Created June 22, 2018 12:38
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;
}