class WebformVariant in Webform 8.5
Same name in this branch
- 8.5 src/Annotation/WebformVariant.php \Drupal\webform\Annotation\WebformVariant
- 8.5 src/Element/WebformVariant.php \Drupal\webform\Element\WebformVariant
- 8.5 src/Plugin/WebformElement/WebformVariant.php \Drupal\webform\Plugin\WebformElement\WebformVariant
Same name and namespace in other branches
- 6.x src/Annotation/WebformVariant.php \Drupal\webform\Annotation\WebformVariant
Defines a webform variant annotation object.
Plugin Namespace: Plugin\WebformVariant.
For a working example, see \Drupal\webform\Plugin\WebformVariant\OverrideWebformVariant
Hierarchy
- class \Drupal\Component\Annotation\Plugin implements AnnotationInterface
- class \Drupal\webform\Annotation\WebformVariant
Expanded class hierarchy of WebformVariant
See also
hook_webform_variant_info_alter()
\Drupal\webform\Plugin\WebformVariantInterface
\Drupal\webform\Plugin\WebformVariantBase
\Drupal\webform\Plugin\WebformVariantManager
5 classes are annotated with WebformVariant
- BrokenWebformVariant in src/
Plugin/ WebformVariant/ BrokenWebformVariant.php - Defines a fallback plugin for missing webform variant plugins.
- ExampleWebformVariant in modules/
webform_example_variant/ src/ Plugin/ WebformVariant/ ExampleWebformVariant.php - Webform example variant.
- OverrideWebformVariant in src/
Plugin/ WebformVariant/ OverrideWebformVariant.php - Webform override variant.
- TestWebformOffCanvasWidthVariant in tests/
modules/ webform_test_variant/ src/ Plugin/ WebformVariant/ TestWebformOffCanvasWidthVariant.php - Webform variant off-canvas width.
- TestWebformVariant in tests/
modules/ webform_test_variant/ src/ Plugin/ WebformVariant/ TestWebformVariant.php - Webform example variant.
File
- src/
Annotation/ WebformVariant.php, line 23
Namespace
Drupal\webform\AnnotationView source
class WebformVariant extends Plugin {
/**
* The plugin ID.
*
* @var string
*/
public $id;
/**
* The human-readable name of the webform variant.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $label;
/**
* The category in the admin UI where the block will be listed.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $category = '';
/**
* A brief description of the webform variant.
*
* This will be shown when adding or configuring this webform variant.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $description = '';
/**
* The machine name replacement pattern.
*
* @var string
*/
public $machine_name_replace_pattern = '[^a-z0-9_]+';
/**
* The machine name replacement character.
*
* @var string
*/
public $machine_name_replace = '_';
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Plugin:: |
protected | property | The plugin definition read from the class annotation. | 1 |
Plugin:: |
public | function |
Gets the value of an annotation. Overrides AnnotationInterface:: |
5 |
Plugin:: |
public | function |
Gets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the unique ID for this annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
protected | function | Parses an annotation into its definition. | |
Plugin:: |
public | function |
Sets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Sets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function | Constructs a Plugin object. | 2 |
WebformVariant:: |
public | property | The category in the admin UI where the block will be listed. | |
WebformVariant:: |
public | property | A brief description of the webform variant. | |
WebformVariant:: |
public | property | The plugin ID. | |
WebformVariant:: |
public | property | The human-readable name of the webform variant. | |
WebformVariant:: |
public | property | The machine name replacement character. | |
WebformVariant:: |
public | property | The machine name replacement pattern. |