public function WebformElementBase::getLabel in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElementBase.php \Drupal\webform\Plugin\WebformElementBase::getLabel()
Get an element's label (#title or #webform_key).
Parameters
array $element: An element.
Return value
string An element's label (#title or #webform_key).
Overrides WebformElementInterface::getLabel
1 call to WebformElementBase::getLabel()
- WebformElementBase::displayDisabledWarning in src/
Plugin/ WebformElementBase.php - Display element disabled warning.
File
- src/
Plugin/ WebformElementBase.php, line 1290
Class
- WebformElementBase
- Provides a base class for a webform element.
Namespace
Drupal\webform\PluginCode
public function getLabel(array $element) {
return !empty($element['#title']) ? $element['#title'] : $element['#webform_key'];
}