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

Breadcrumb

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

function ChoiceFormField::untick

Unticks a checkbox.

Throws

\LogicException When the type provided is not correct

File

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

Class

ChoiceFormField
ChoiceFormField represents a choice form field.

Namespace

Symfony\Component\DomCrawler\Field

Code

public function untick() : void {
    if ('checkbox' !== $this->type) {
        throw new \LogicException(\sprintf('You cannot untick "%s" as it is not a checkbox (%s).', $this->name, $this->type));
    }
    $this->setValue(false);
}
RSS feed
Powered by Drupal