public function WebformVariant::buildText in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformElement/WebformVariant.php \Drupal\webform\Plugin\WebformElement\WebformVariant::buildText()
Build an element as text element.
Parameters
array $element: An element.
\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.
array $options: An array of options.
Return value
array A render array representing an element as text.
Overrides WebformDisplayOnTrait::buildText
File
- src/
Plugin/ WebformElement/ WebformVariant.php, line 117
Class
- WebformVariant
- Provides a 'webform_variant' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function buildText(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
// Hide element if it should not be displayed on 'view'.
if (!$this
->isDisplayOn($element, WebformElementDisplayOnInterface::DISPLAY_ON_VIEW)) {
return [];
}
return parent::buildText($element, $webform_submission, $options);
}