protected function YamlFormCompositeBase::getCompositeElementOptions in YAML Form 8
Get form option keys for composite element based on the composite element's key.
Parameters
string $composite_key: A composite element's key.
Return value
array An array form options.
1 call to YamlFormCompositeBase::getCompositeElementOptions()
- YamlFormCompositeBase::buildCompositeElementsTable in src/
Plugin/ YamlFormElement/ YamlFormCompositeBase.php - Build the composite elements settings table.
File
- src/
Plugin/ YamlFormElement/ YamlFormCompositeBase.php, line 636
Class
- YamlFormCompositeBase
- Provides a base for composite elements.
Namespace
Drupal\yamlform\Plugin\YamlFormElementCode
protected function getCompositeElementOptions($composite_key) {
/** @var \Drupal\yamlform\YamlFormOptionsInterface[] $yamlform_options */
$yamlform_options = YamlFormOptions::loadMultiple();
$options = [];
foreach ($yamlform_options as $key => $yamlform_option) {
if (strpos($key, $composite_key) === 0) {
$options[$key] = $yamlform_option
->label();
}
}
return $options;
}