Skip to content

Instantly share code, notes, and snippets.

@vivianspencer
Last active December 21, 2018 09:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vivianspencer/656c8eee367f44e4742192c7e56e39f8 to your computer and use it in GitHub Desktop.
Save vivianspencer/656c8eee367f44e4742192c7e56e39f8 to your computer and use it in GitHub Desktop.
Drupal 8 Get allowed values of field
$values = FieldConfig::loadByName('node', 'BUNDLE', 'FIELD')->getSetting('allowed_values');
@JMStewart00
Copy link

What a lifesaver.

@avinash2209
Copy link

avinash2209 commented Dec 21, 2018

for me too. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment