You are here

public function WebformHorizontalRule::preview in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformHorizontalRule.php \Drupal\webform\Plugin\WebformElement\WebformHorizontalRule::preview()

Generate a renderable preview of the element.

Return value

array A renderable preview of the element.

Overrides WebformElementBase::preview

File

src/Plugin/WebformElement/WebformHorizontalRule.php, line 138

Class

WebformHorizontalRule
Provides a 'webform_horizontal_rule' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function preview() {
  return [
    '#type' => $this
      ->getTypeName(),
    '#attributes' => [
      'class' => [
        'webform-horizontal-rule--dotted',
        'webform-horizontal-rule--thick',
      ],
    ],
  ];
}