You are here

class WebformElement in Webform 8.5

Same name in this branch
  1. 8.5 src/Annotation/WebformElement.php \Drupal\webform\Annotation\WebformElement
  2. 8.5 src/Plugin/WebformElement/WebformElement.php \Drupal\webform\Plugin\WebformElement\WebformElement
Same name and namespace in other branches
  1. 6.x src/Annotation/WebformElement.php \Drupal\webform\Annotation\WebformElement

Defines a webform element annotation object.

Plugin Namespace: Plugin\WebformElement.

For a working example, see \Drupal\webform\Plugin\WebformElement\Email

Hierarchy

Expanded class hierarchy of WebformElement

See also

hook_webform_element_info_alter()

\Drupal\webform\Plugin\WebformElementInterface

\Drupal\webform\Plugin\WebformElementBase

\Drupal\webform\Plugin\WebformElementManager

\Drupal\webform\Plugin\WebformElementManagerInterface

Plugin API

105 classes are annotated with WebformElement
Address in src/Plugin/WebformElement/Address.php
Provides a 'address' element.
Captcha in src/Plugin/WebformElement/Captcha.php
Provides a 'captcha' element.
Checkbox in src/Plugin/WebformElement/Checkbox.php
Provides a 'checkbox' element.
Checkboxes in src/Plugin/WebformElement/Checkboxes.php
Provides a 'checkboxes' element.
Color in src/Plugin/WebformElement/Color.php
Provides a 'color' element.

... See full list

File

src/Annotation/WebformElement.php, line 24

Namespace

Drupal\webform\Annotation
View source
class WebformElement extends Plugin {

  /**
   * The plugin ID.
   *
   * @var string
   */
  public $id;

  /**
   * URL to the element's API documentation.
   *
   * @var string
   */
  public $api;

  /**
   * The element's module dependencies.
   *
   * @var array
   *
   * @see webform_webform_element_info_alter()
   */
  public $dependencies = [];

  /**
   * The human-readable name of the webform element.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $label;

  /**
   * The default key used for new webform element.
   *
   * @var string
   */
  public $default_key = '';

  /**
   * The category in the admin UI where the webform will be listed.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $category = '';

  /**
   * A brief description of the webform element.
   *
   * This will be shown when adding or configuring this webform element.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $description = '';

  /**
   * Flag that defines hidden element.
   *
   * @var bool
   */
  public $hidden = FALSE;

  /**
   * Flag that defines multiline element.
   *
   * @var bool
   */
  public $multiline = FALSE;

  /**
   * Flag that defines composite element.
   *
   * @var bool
   */
  public $composite = FALSE;

  /**
   * Flag that defines if #states wrapper should applied be to the element.
   *
   * @var bool
   */
  public $states_wrapper = FALSE;

  /**
   * Flag that indicates the element has been deprecated.
   *
   * @var bool
   */
  public $deprecated = FALSE;

  /**
   * Deprecated message.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $deprecated_message = '';

}

Members

Namesort descending Modifiers Type Description Overrides
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 5
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 2
WebformElement::$api public property URL to the element's API documentation.
WebformElement::$category public property The category in the admin UI where the webform will be listed.
WebformElement::$composite public property Flag that defines composite element.
WebformElement::$default_key public property The default key used for new webform element.
WebformElement::$dependencies public property The element's module dependencies.
WebformElement::$deprecated public property Flag that indicates the element has been deprecated.
WebformElement::$deprecated_message public property Deprecated message.
WebformElement::$description public property A brief description of the webform element.
WebformElement::$hidden public property Flag that defines hidden element.
WebformElement::$id public property The plugin ID.
WebformElement::$label public property The human-readable name of the webform element.
WebformElement::$multiline public property Flag that defines multiline element.
WebformElement::$states_wrapper public property Flag that defines if #states wrapper should applied be to the element.