class Value
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Render/Element/Value.php \Drupal\Core\Render\Element\Value
- 10 core/lib/Drupal/Core/Render/Element/Value.php \Drupal\Core\Render\Element\Value
- 9 core/lib/Drupal/Core/Render/Element/Value.php \Drupal\Core\Render\Element\Value
- 8.9.x core/lib/Drupal/Core/Render/Element/Value.php \Drupal\Core\Render\Element\Value
Provides a form element for storage of internal information.
Unlike \Drupal\Core\Render\Element\Hidden, this information is not sent to the browser in a hidden form field, but only stored in the form array for use in validation and submit processing.
Properties:
- #value: The value of the form element that cannot be edited by the user.
Usage Example:
$form['entity_id'] = [
'#type' => 'value',
'#value' => $entity_id,
];
Attributes
#[FormElement('value')]
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\Core\Render\Element\RenderElementBase implements \Drupal\Core\Render\Element\ElementInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Render\Element\FormElementBase implements \Drupal\Core\Render\Element\FormElementInterface extends \Drupal\Core\Render\Element\RenderElementBase
- class \Drupal\Core\Render\Element\Value extends \Drupal\Core\Render\Element\FormElementBase
- class \Drupal\Core\Render\Element\FormElementBase implements \Drupal\Core\Render\Element\FormElementInterface extends \Drupal\Core\Render\Element\RenderElementBase
- class \Drupal\Core\Render\Element\RenderElementBase implements \Drupal\Core\Render\Element\ElementInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of Value
384 string references to 'Value'
- AccessManagerTest::testCheckNamedRouteWithDefaultValue in core/
tests/ Drupal/ Tests/ Core/ Access/ AccessManagerTest.php - Tests the checkNamedRoute with default values.
- AccessManagerTest::testCheckNamedRouteWithUpcastedValues in core/
tests/ Drupal/ Tests/ Core/ Access/ AccessManagerTest.php - Tests the checkNamedRoute with upcasted values.
- AjaxCommandsTest::testDataCommand in core/
tests/ Drupal/ Tests/ Core/ Ajax/ AjaxCommandsTest.php - Tests data command.
- AjaxCommandsTest::testSettingsCommand in core/
tests/ Drupal/ Tests/ Core/ Ajax/ AjaxCommandsTest.php - Tests settings command.
- AttributesTest::providerTestAttributeData in core/
tests/ Drupal/ Tests/ Core/ Common/ AttributesTest.php - Provides data for the Attribute test.
51 #type uses of Value
- BlockForm::form in core/
modules/ block/ src/ BlockForm.php - BlockInterfaceTest::testBlockInterface in core/
modules/ block/ tests/ src/ Kernel/ BlockInterfaceTest.php - Tests configuration and subsequent form() and build() method calls.
- BlockPluginTrait::buildConfigurationForm in core/
lib/ Drupal/ Core/ Block/ BlockPluginTrait.php - Creates a generic configuration form for all block types. Individual block plugins can add elements to this form by overriding BlockBase::blockForm(). Most block plugins should not override this method unless they need to alter the generic form elements.
- ConfigHandler::buildForm in core/
modules/ views_ui/ src/ Form/ Ajax/ ConfigHandler.php - ContextAwarePluginAssignmentTrait::addContextAssignmentElement in core/
lib/ Drupal/ Core/ Plugin/ ContextAwarePluginAssignmentTrait.php - Builds a form element for assigning a context to a given slot.
File
-
core/
lib/ Drupal/ Core/ Render/ Element/ Value.php, line 22
Namespace
Drupal\Core\Render\ElementView source
class Value extends FormElementBase {
/**
* {@inheritdoc}
*/
public function getInfo() {
return [
'#input' => TRUE,
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.