You are here

public function YamlFormElementBase::getLabel in YAML Form 8

Get an element's label (#title or #yamlform_key).

Parameters

array $element: An element.

Return value

string An element's label (#title or #yamlform_key).

Overrides YamlFormElementInterface::getLabel

1 call to YamlFormElementBase::getLabel()
YamlFormElementBase::displayDisabledWarning in src/YamlFormElementBase.php
Display element disabled warning.

File

src/YamlFormElementBase.php, line 539

Class

YamlFormElementBase
Provides a base class for a form element.

Namespace

Drupal\yamlform

Code

public function getLabel(array $element) {
  return $element['#title'] ?: $element['#yamlform_key'];
}