You are here

public function WebformElementBase::isEmptyExcluded in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformElementBase.php \Drupal\webform\Plugin\WebformElementBase::isEmptyExcluded()

Checks if an empty element is excluded.

Parameters

array $element: An element.

array $options: An array of options.

Return value

bool TRUE if an empty element is excluded.

Overrides WebformElementInterface::isEmptyExcluded

1 call to WebformElementBase::isEmptyExcluded()
WebformElementBase::build in src/Plugin/WebformElementBase.php
Build an element as text or HTML.
1 method overrides WebformElementBase::isEmptyExcluded()
Checkbox::isEmptyExcluded in src/Plugin/WebformElement/Checkbox.php
Checks if an empty element is excluded.

File

src/Plugin/WebformElementBase.php, line 1926

Class

WebformElementBase
Provides a base class for a webform element.

Namespace

Drupal\webform\Plugin

Code

public function isEmptyExcluded(array $element, array $options) {
  $options += [
    'exclude_empty' => TRUE,
  ];
  return !empty($options['exclude_empty']);
}