You are here

public function YamlFormElementBase::buildExportHeader in YAML Form 8

Build an element's export header.

Parameters

array $element: An element.

array $options: An associative array of export options.

Return value

array An array containing the element's export headers.

Overrides YamlFormElementInterface::buildExportHeader

See also

\Drupal\yamlform\YamlFormSubmissionExporterInterface::getDefaultExportOptions

1 call to YamlFormElementBase::buildExportHeader()
OptionsBase::buildExportHeader in src/Plugin/YamlFormElement/OptionsBase.php
Build an element's export header.
3 methods override YamlFormElementBase::buildExportHeader()
OptionsBase::buildExportHeader in src/Plugin/YamlFormElement/OptionsBase.php
Build an element's export header.
YamlFormCompositeBase::buildExportHeader in src/Plugin/YamlFormElement/YamlFormCompositeBase.php
Build an element's export header.
YamlFormLikert::buildExportHeader in src/Plugin/YamlFormElement/YamlFormLikert.php
Build an element's export header.

File

src/YamlFormElementBase.php, line 731

Class

YamlFormElementBase
Provides a base class for a form element.

Namespace

Drupal\yamlform

Code

public function buildExportHeader(array $element, array $export_options) {
  if ($export_options['header_format'] == 'label') {
    return [
      $this
        ->getAdminLabel($element),
    ];
  }
  else {
    return [
      $element['#yamlform_key'],
    ];
  }
}