public function Details::prepare in YAML Form 8
Prepare an element to be rendered within a form.
Parameters
array $element: An element.
\Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission: A form submission.
Overrides YamlFormElementBase::prepare
File
- src/
Plugin/ YamlFormElement/ Details.php, line 32
Class
- Details
- Provides a 'details' element.
Namespace
Drupal\yamlform\Plugin\YamlFormElementCode
public function prepare(array &$element, YamlFormSubmissionInterface $yamlform_submission) {
parent::prepare($element, $yamlform_submission);
if (isset($element['#yamlform_key'])) {
$element['#attributes']['data-yamlform-key'] = $element['#yamlform_key'];
}
}