PHP Class Symfony\Component\DomCrawler\Field\ChoiceFormField

It is constructed from a HTML select tag, or a HTML checkbox, or radio inputs.
Author: Fabien Potencier ([email protected])
Inheritance: extends FormField
Afficher le fichier Open project: symfony/dom-crawler Class Usage Examples

Méthodes publiques

Méthode Description
addChoice ( DOMElement $node ) Adds a choice to the current ones.
availableOptionValues ( ) : array Returns list of available field options.
containsOption ( string $optionValue, array $options ) : boolean Checks whether given value is in the existing options.
disableValidation ( ) : self Disables the internal validation of the field.
getType ( ) : string Returns the type of the choice field (radio, select, or checkbox).
hasValue ( ) : boolean Returns true if the field should be included in the submitted values.
isDisabled ( ) : boolean Check if the current selected option is disabled.
isMultiple ( ) : boolean Returns true if the field accepts multiple values.
select ( string $value ) Sets the value of the field.
setValue ( string $value ) Sets the value of the field.
tick ( ) Ticks a checkbox.
untick ( ) Ticks a checkbox.

Méthodes protégées

Méthode Description
initialize ( ) Initializes the form field.

Private Methods

Méthode Description
buildOptionValue ( DOMElement $node ) : array Returns option value with associated disabled flag.

Method Details

addChoice() public méthode

Adds a choice to the current ones.
public addChoice ( DOMElement $node )
$node DOMElement

availableOptionValues() public méthode

Returns list of available field options.
public availableOptionValues ( ) : array
Résultat array

containsOption() public méthode

Checks whether given value is in the existing options.
public containsOption ( string $optionValue, array $options ) : boolean
$optionValue string
$options array
Résultat boolean

disableValidation() public méthode

Disables the internal validation of the field.
public disableValidation ( ) : self
Résultat self

getType() public méthode

Returns the type of the choice field (radio, select, or checkbox).
public getType ( ) : string
Résultat string The type

hasValue() public méthode

Returns true if the field should be included in the submitted values.
public hasValue ( ) : boolean
Résultat boolean true if the field should be included in the submitted values, false otherwise

initialize() protected méthode

Initializes the form field.
protected initialize ( )

isDisabled() public méthode

Check if the current selected option is disabled.
public isDisabled ( ) : boolean
Résultat boolean

isMultiple() public méthode

Returns true if the field accepts multiple values.
public isMultiple ( ) : boolean
Résultat boolean true if the field accepts multiple values, false otherwise

select() public méthode

Sets the value of the field.
public select ( string $value )
$value string The value of the field

setValue() public méthode

Sets the value of the field.
public setValue ( string $value )
$value string The value of the field

tick() public méthode

Ticks a checkbox.
public tick ( )

untick() public méthode

Ticks a checkbox.
public untick ( )