123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Symfony\Component\DomCrawler\Field;
- class InputFormField extends FormField
- {
-
- 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');
- }
- }
|