You are here

public static function WebformOptionsHelper::splitOption in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Utility/WebformOptionsHelper.php \Drupal\webform\Utility\WebformOptionsHelper::splitOption()

Split option text into an array containing an option's text and description.

Parameters

string $text: Option text.

Return value

array An array containing an option's text and description.

14 calls to WebformOptionsHelper::splitOption()
Checkboxes::getElementSelectorInputsOptions in src/Plugin/WebformElement/Checkboxes.php
Get an element's (sub)inputs selectors as options.
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.
WebformLikert::formatHtmlItem in src/Plugin/WebformElement/WebformLikert.php
Format an element's value as HTML.
WebformLikert::processWebformLikert in src/Element/WebformLikert.php
Processes a likert scale webform element.

... See full list

File

src/Utility/WebformOptionsHelper.php, line 106

Class

WebformOptionsHelper
Helper class webform options based methods.

Namespace

Drupal\webform\Utility

Code

public static function splitOption($text) {
  return explode(static::DESCRIPTION_DELIMITER, $text);
}