Skip to content

Instantly share code, notes, and snippets.

@vivianspencer
Last active December 21, 2018 09:07
Show Gist options
  • Select an option

  • Save vivianspencer/656c8eee367f44e4742192c7e56e39f8 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

What a lifesaver.

@avinash2209

avinash2209 commented Dec 21, 2018 •

Copy link
Copy Markdown

for me too. Thank you.

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