public function WebformHorizontalRule::buildHtml in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformElement/WebformHorizontalRule.php \Drupal\webform\Plugin\WebformElement\WebformHorizontalRule::buildHtml()
Build an element as HTML 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 HTML.
Overrides WebformDisplayOnTrait::buildHtml
File
- src/
Plugin/ WebformElement/ WebformHorizontalRule.php, line 69
Class
- WebformHorizontalRule
- Provides a 'webform_horizontal_rule' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function buildHtml(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 $element;
}