public function WebformLikert::buildExportHeader in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElement/WebformLikert.php \Drupal\webform\Plugin\WebformElement\WebformLikert::buildExportHeader()
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 WebformElementBase::buildExportHeader
See also
\Drupal\webform\WebformSubmissionExporterInterface::getDefaultExportOptions
File
- src/
Plugin/ WebformElement/ WebformLikert.php, line 261
Class
- WebformLikert
- Provides a 'likert' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function buildExportHeader(array $element, array $options) {
$header = [];
foreach ($element['#questions'] as $key => $label) {
$header[] = $options['header_format'] === 'key' ? $key : $label;
}
return $this
->prefixExportHeader($header, $element, $options);
}