protected function WebformElementBase::prepareCompositeFormElement in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElementBase.php \Drupal\webform\Plugin\WebformElementBase::prepareCompositeFormElement()
Replace Core's composite #pre_render with Webform's composite #pre_render.
Parameters
array $element: An element.
See also
\Drupal\Core\Render\Element\CompositeFormElementTrait
\Drupal\webform\Element\WebformCompositeFormElementTrait
1 call to WebformElementBase::prepareCompositeFormElement()
- WebformElementBase::finalize in src/
Plugin/ WebformElementBase.php - Finalize an element to be rendered within a webform.
File
- src/
Plugin/ WebformElementBase.php, line 1100
Class
- WebformElementBase
- Provides a base class for a webform element.
Namespace
Drupal\webform\PluginCode
protected function prepareCompositeFormElement(array &$element) {
if (empty($element['#pre_render'])) {
return;
}
// Replace preRenderCompositeFormElement with
// preRenderWebformCompositeFormElement.
foreach ($element['#pre_render'] as $index => $pre_render) {
if (is_array($pre_render) && $pre_render[1] === 'preRenderCompositeFormElement') {
$element['#pre_render'][$index] = [
get_called_class(),
'preRenderWebformCompositeFormElement',
];
}
}
}