
| Current Path : /var/www/html/c12park/web/modules/contrib/webform/src/Plugin/WebformElement/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/c12park/web/modules/contrib/webform/src/Plugin/WebformElement/Value.php |
<?php
namespace Drupal\webform\Plugin\WebformElement;
use Drupal\webform\Plugin\WebformElementBase;
use Drupal\webform\WebformInterface;
/**
* Provides a 'value' element.
*
* @WebformElement(
* id = "value",
* api = "https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Element!Value.php/class/Value",
* label = @Translation("Value"),
* description = @Translation("Provides a form element for storage of internal information."),
* category = @Translation("Advanced elements"),
* )
*/
class Value extends WebformElementBase {
/**
* {@inheritdoc}
*/
protected function defineDefaultProperties() {
return [
// Element settings.
'title' => '',
'value' => '',
];
}
/* ************************************************************************ */
/**
* {@inheritdoc}
*/
public function preview() {
return [
'#type' => 'value',
'#title' => $this->t('Value'),
'#value' => 'preview',
];
}
/**
* {@inheritdoc}
*/
public function getTestValues(array $element, WebformInterface $webform, array $options = []) {
// Value elements should never get a test value.
return NULL;
}
}