public function YamlFormLikert::initialize in YAML Form 8
Initialize an element to be displayed, rendered, or exported.
Parameters
array $element: An element.
Overrides YamlFormElementBase::initialize
File
- src/
Plugin/ YamlFormElement/ YamlFormLikert.php, line 62
Class
- YamlFormLikert
- Provides a 'likert' element.
Namespace
Drupal\yamlform\Plugin\YamlFormElementCode
public function initialize(array &$element) {
parent::initialize($element);
// Set element answers.
if (isset($element['#answers'])) {
$element['#answers'] = YamlFormOptions::getElementOptions($element, '#answers');
}
// Process answers and set N/A.
YamlFormLikertElement::processYamlFormLikertAnswers($element);
}