You are here

public function PatternDefinition::getFieldsAsOptions in UI Patterns 8

Get field as options.

Return value

array Fields as select options.

File

src/Definition/PatternDefinition.php, line 206

Class

PatternDefinition
Class PatternDefinition.

Namespace

Drupal\ui_patterns\Definition

Code

public function getFieldsAsOptions() {
  $options = [];
  foreach ($this
    ->getFields() as $field) {
    $options[$field
      ->getName()] = $field
      ->getLabel();
  }
  return $options;
}