public static function WebformFlexbox::processContainer in Webform 8.5
Same name and namespace in other branches
- 6.x src/Element/WebformFlexbox.php \Drupal\webform\Element\WebformFlexbox::processContainer()
Processes a container element.
Parameters
array $element: An associative array containing the properties and children of the container.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
array $complete_form: The complete form structure.
Return value
array The processed element.
Overrides Container::processContainer
File
- src/
Element/ WebformFlexbox.php, line 18
Class
- WebformFlexbox
- Provides a render element for webform flexbox.
Namespace
Drupal\webform\ElementCode
public static function processContainer(&$element, FormStateInterface $form_state, &$complete_form) {
$element = parent::processContainer($element, $form_state, $complete_form);
$element['#attributes']['class'][] = 'webform-flexbox';
$element['#attributes']['class'][] = 'js-webform-flexbox';
if (isset($element['#align_items'])) {
$element['#attributes']['class'][] = 'webform-flexbox--' . $element['#align_items'];
}
$element['#attributes']['class'][] = 'js-form-wrapper';
$element['#attached']['library'][] = 'webform/webform.element.flexbox';
return $element;
}