Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ChoiceFormField.php

function ChoiceFormField::hasValue

Returns true if the field should be included in the submitted values.

Return value

bool true if the field should be included in the submitted values, false otherwise

Overrides FormField::hasValue

File

vendor/symfony/dom-crawler/Field/ChoiceFormField.php, line 33

Class

ChoiceFormField
ChoiceFormField represents a choice form field.

Namespace

Symfony\Component\DomCrawler\Field

Code

public function hasValue() : bool {
    // don't send a value for unchecked checkboxes
    if (\in_array($this->type, [
        'checkbox',
        'radio',
    ]) && null === $this->value) {
        return false;
    }
    return true;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal