public static function YamlFormOptionsHelper::getOptionsText in YAML Form 8
Replace associative array of option values with option text.
Parameters
array $values: The option value.
array $options: An associative array of options.
Return value
array An associative array of option values with option text.
4 calls to YamlFormOptionsHelper::getOptionsText()
- OptionsBase::buildExportRecord in src/
Plugin/ YamlFormElement/ OptionsBase.php - Build an element's export row.
- OptionsBase::formatHtml in src/
Plugin/ YamlFormElement/ OptionsBase.php - Format an element's value as HTML.
- OptionsBase::formatText in src/
Plugin/ YamlFormElement/ OptionsBase.php - Format an element's value as plain text.
- YamlFormOptionsHelperTest::testGetOptionsText in tests/
src/ Unit/ YamlFormOptionsHelperTest.php - Tests YamlFormOptionsHelper::getOptionsText().
File
- src/
Utility/ YamlFormOptionsHelper.php, line 46
Class
- YamlFormOptionsHelper
- Helper class form options based methods.
Namespace
Drupal\yamlform\UtilityCode
public static function getOptionsText(array $values, array $options) {
foreach ($values as &$value) {
$value = self::getOptionText($value, $options);
}
return $values;
}