Symfony\Component\DomCrawler\Field\ChoiceFormField
ChoiceFormField represents a choice form field.
It is constructed from a HTML select tag, or a HTML checkbox, or radio inputs.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class ChoiceFormField
extends FormField
{
- // Inherited members from FormField
- protected DOMNode $node;
- protected string $name;
- protected string $value;
- protected DOMDocument $document;
- protected DOMXPath $xpath;
- protected Boolean $disabled;
- // methods
- public Boolean hasValue()
- public Boolean isDisabled()
- public void select()
- public void tick()
- public void untick()
- public void setValue()
- public void addChoice()
- public string getType()
- public Boolean isMultiple()
- protected void initialize()
- private array buildOptionValue()
- public bool containsOption()
- public array availableOptionValues()
- // Inherited methods from FormField
- public void __construct()
- public string getName()
- public string|array getValue()
- public void setValue()
- public Boolean hasValue()
- public Boolean isDisabled()
- protected abstract void initialize()
Hierarchy
Members
private
- $multiple — Symfony\Component\DomCrawler\Field\Boolean
- $options — array
- $type — string
protected
- $disabled — Symfony\Component\DomCrawler\Field\Boolean
- $document — \DOMDocument
- $name — string
- $node — \DOMNode
- $value — string
- $xpath — \DOMXPath
Methods
private
- buildOptionValue() — Returns option value with associated disabled flag
protected
- initialize() — Initializes the form field.
public
- addChoice() — Adds a choice to the current ones.
- availableOptionValues() — Returns list of available field options
- containsOption() — Checks whether given vale is in the existing options
- getType() — Returns the type of the choice field (radio, select, or checkbox).
- hasValue() — Returns true if the field should be included in the submitted values.
- isDisabled() — Check if the current selected option is disabled
- isMultiple() — Returns true if the field accepts multiple values.
- select() — Sets the value of the field.
- setValue() — Sets the value of the field.
- tick() — Ticks a checkbox.
- untick() — Ticks a checkbox.
Inherited from Symfony\Component\DomCrawler\Field\FormField
protected
- initialize() — Initializes the form field.
public
- getName() — Returns the name of the field.
- getValue() — Gets the value of the field.
- hasValue() — Returns true if the field should be included in the submitted values.
- isDisabled() — Check if the current field is disabled
- setValue() — Sets the value of the field.