You are here

public function WebformElementBase::getItemsFormat in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElementBase.php \Drupal\webform\Plugin\WebformElementBase::getItemsFormat()

Get element's multiple value format name by looking for '#format' property, global settings, and finally default settings.

Parameters

array $element: An element.

Return value

string An element's format name.

Overrides WebformElementInterface::getItemsFormat

9 calls to WebformElementBase::getItemsFormat()
OptionsBase::formatHtmlItems in src/Plugin/WebformElement/OptionsBase.php
Format an element's items as HTML.
OptionsBase::formatTextItems in src/Plugin/WebformElement/OptionsBase.php
Format an element's items as text.
OptionsBase::isMultiline in src/Plugin/WebformElement/OptionsBase.php
Checks if the element value could contain multiple lines.
WebformCompositeBase::formatHtmlItems in src/Plugin/WebformElement/WebformCompositeBase.php
Format an element's items as HTML.
WebformCompositeBase::formatTextItems in src/Plugin/WebformElement/WebformCompositeBase.php
Format an element's items as text.

... See full list

File

src/Plugin/WebformElementBase.php, line 1858

Class

WebformElementBase
Provides a base class for a webform element.

Namespace

Drupal\webform\Plugin

Code

public function getItemsFormat(array $element) {
  if (isset($element['#format_items'])) {
    return $element['#format_items'];
  }
  elseif ($default_format = $this->configFactory
    ->get('webform.settings')
    ->get('format.' . $this
    ->getPluginId() . '.items')) {
    return $default_format;
  }
  else {
    return $this
      ->getItemsDefaultFormat();
  }
}