class InputFormField in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/dom-crawler/Field/InputFormField.php \Symfony\Component\DomCrawler\Field\InputFormField
InputFormField represents an input form field (an HTML input tag).
For inputs with type of file, checkbox, or radio, there are other more specialized classes (cf. FileFormField and ChoiceFormField).
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\DomCrawler\Field\FormField
- class \Symfony\Component\DomCrawler\Field\InputFormField
Expanded class hierarchy of InputFormField
3 files declare their use of InputFormField
- BrowserKitDriver.php in vendor/
behat/ mink-browserkit-driver/ src/ BrowserKitDriver.php - FormFieldTest.php in vendor/
symfony/ dom-crawler/ Tests/ Field/ FormFieldTest.php - InputFormFieldTest.php in vendor/
symfony/ dom-crawler/ Tests/ Field/ InputFormFieldTest.php
1 string reference to 'InputFormField'
- FormTest::provideInitializeValues in vendor/
symfony/ dom-crawler/ Tests/ FormTest.php
File
- vendor/
symfony/ dom-crawler/ Field/ InputFormField.php, line 22
Namespace
Symfony\Component\DomCrawler\FieldView source
class InputFormField extends FormField {
/**
* Initializes the form field.
*
* @throws \LogicException When node type is incorrect
*/
protected function initialize() {
if ('input' !== $this->node->nodeName && 'button' !== $this->node->nodeName) {
throw new \LogicException(sprintf('An InputFormField can only be created from an input or button tag (%s given).', $this->node->nodeName));
}
if ('checkbox' === strtolower($this->node
->getAttribute('type'))) {
throw new \LogicException('Checkboxes should be instances of ChoiceFormField.');
}
if ('file' === strtolower($this->node
->getAttribute('type'))) {
throw new \LogicException('File inputs should be instances of FileFormField.');
}
$this->value = $this->node
->getAttribute('value');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FormField:: |
protected | property | ||
FormField:: |
protected | property | ||
FormField:: |
protected | property | ||
FormField:: |
protected | property | ||
FormField:: |
protected | property | ||
FormField:: |
protected | property | ||
FormField:: |
public | function | Returns the name of the field. | |
FormField:: |
public | function | Gets the value of the field. | |
FormField:: |
public | function | Returns true if the field should be included in the submitted values. | 1 |
FormField:: |
public | function | Check if the current field is disabled. | 1 |
FormField:: |
public | function | Sets the value of the field. | 2 |
FormField:: |
public | function | Constructor. | |
InputFormField:: |
protected | function |
Initializes the form field. Overrides FormField:: |