function FieldPluginBase::elementWrapperType

Same name and namespace in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::elementWrapperType()
  2. 10 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::elementWrapperType()
  3. 11.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::elementWrapperType()

Overrides FieldHandlerInterface::elementWrapperType

File

core/modules/views/src/Plugin/views/field/FieldPluginBase.php, line 298

Class

FieldPluginBase
Base class for views fields.

Namespace

Drupal\views\Plugin\views\field

Code

public function elementWrapperType($none_supported = FALSE, $default_empty = FALSE) {
    if ($none_supported) {
        if ($this->options['element_wrapper_type'] === '0') {
            return 0;
        }
    }
    if ($this->options['element_wrapper_type']) {
        return $this->options['element_wrapper_type'];
    }
    if ($default_empty) {
        return '';
    }
    return 'div';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.