PHP Класс Symfony\Component\DomCrawler\Field\ChoiceFormField

It is constructed from a HTML select tag, or a HTML checkbox, or radio inputs.
Автор: Fabien Potencier ([email protected])
Наследование: extends FormField
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
initialize ( ) Initializes the form field.

Приватные методы

Метод Описание
buildOptionValue ( DOMElement $node ) : array Returns option value with associated disabled flag.

Описание методов

addChoice() публичный Метод

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

availableOptionValues() публичный Метод

Returns list of available field options.
public availableOptionValues ( ) : array
Результат array

containsOption() публичный Метод

Checks whether given value is in the existing options.
public containsOption ( string $optionValue, array $options ) : boolean
$optionValue string
$options array
Результат boolean

disableValidation() публичный Метод

Disables the internal validation of the field.
public disableValidation ( ) : self
Результат self

getType() публичный Метод

Returns the type of the choice field (radio, select, or checkbox).
public getType ( ) : string
Результат string The type

hasValue() публичный Метод

Returns true if the field should be included in the submitted values.
public hasValue ( ) : boolean
Результат boolean true if the field should be included in the submitted values, false otherwise

initialize() защищенный Метод

Initializes the form field.
protected initialize ( )

isDisabled() публичный Метод

Check if the current selected option is disabled.
public isDisabled ( ) : boolean
Результат boolean

isMultiple() публичный Метод

Returns true if the field accepts multiple values.
public isMultiple ( ) : boolean
Результат boolean true if the field accepts multiple values, false otherwise

select() публичный Метод

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

setValue() публичный Метод

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

tick() публичный Метод

Ticks a checkbox.
public tick ( )

untick() публичный Метод

Ticks a checkbox.
public untick ( )