You are here

public static function YamlFormLocation::preRenderCompositeFormElement in YAML Form 8

Adds form element theming to an element if its title or description is set.

This is used as a pre render function for checkboxes and radios.

Overrides YamlFormCompositeBase::preRenderCompositeFormElement

File

src/Element/YamlFormLocation.php, line 91

Class

YamlFormLocation
Provides a form element for a location element.

Namespace

Drupal\yamlform\Element

Code

public static function preRenderCompositeFormElement($element) {
  $element = YamlFormCompositeBase::preRenderCompositeFormElement($element);

  // Hide location element form display only if #geolocation is also set.
  if (!empty($element['#hidden']) && !empty($element['#geolocation'])) {
    $element['#attributes']['style'] = 'display: none';
  }
  return $element;
}