You are here

public function WebformElementBase::getElementProperty in Webform 8.5

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

Get an element's property value.

Parameters

array $element: An element.

string $property_name: An element's property name.

Return value

mixed An element's property value, default value, or NULL if property does not exist.

Overrides WebformElementInterface::getElementProperty

9 calls to WebformElementBase::getElementProperty()
Checkbox::isEmptyExcluded in src/Plugin/WebformElement/Checkbox.php
Checks if an empty element is excluded.
Checkboxes::initialize in src/Plugin/WebformElement/Checkboxes.php
Initialize an element to be displayed, rendered, or exported.
DateBase::prepare in src/Plugin/WebformElement/DateBase.php
Prepare an element to be rendered within a webform.
DateTime::prepare in src/Plugin/WebformElement/DateTime.php
Prepare an element to be rendered within a webform.
Telephone::prepare in src/Plugin/WebformElement/Telephone.php
Prepare an element to be rendered within a webform.

... See full list

File

src/Plugin/WebformElementBase.php, line 433

Class

WebformElementBase
Provides a base class for a webform element.

Namespace

Drupal\webform\Plugin

Code

public function getElementProperty(array $element, $property_name) {
  return isset($element["#{$property_name}"]) ? $element["#{$property_name}"] : $this
    ->getDefaultProperty($property_name);
}