You are here

Label.php in Webform 6.x

Same filename and directory in other branches
  1. 8.5 src/Plugin/WebformElement/Label.php

File

src/Plugin/WebformElement/Label.php
View source
<?php

namespace Drupal\webform\Plugin\WebformElement;


/**
 * Provides a 'label' element.
 *
 * @WebformElement(
 *   id = "label",
 *   api = "https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Element!Label.php/class/Label",
 *   label = @Translation("Label"),
 *   description = @Translation("Provides an element for displaying the label for a form element."),
 *   category = @Translation("Markup elements"),
 *   states_wrapper = TRUE,
 * )
 */
class Label extends WebformMarkupBase {

  /**
   * {@inheritdoc}
   */
  protected function defineDefaultProperties() {
    return [
      'title' => '',
      // General settings.
      'description' => '',
      // Form validation.
      'required' => FALSE,
      // Attributes.
      'attributes' => [],
    ] + $this
      ->defineDefaultBaseProperties();
  }

  /****************************************************************************/

  /**
   * {@inheritdoc}
   */
  public function getItemDefaultFormat() {
    return NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getItemFormats() {
    return [];
  }

}

Classes

Namesort descending Description
Label Provides a 'label' element.