Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\DomCrawler\Field; Chris@0: Chris@0: /** Chris@0: * TextareaFormField represents a textarea form field (an HTML textarea tag). Chris@0: * Chris@0: * @author Fabien Potencier Chris@0: */ Chris@0: class TextareaFormField extends FormField Chris@0: { Chris@0: /** Chris@0: * Initializes the form field. Chris@0: * Chris@0: * @throws \LogicException When node type is incorrect Chris@0: */ Chris@0: protected function initialize() Chris@0: { Chris@0: if ('textarea' !== $this->node->nodeName) { Chris@0: throw new \LogicException(sprintf('A TextareaFormField can only be created from a textarea tag (%s given).', $this->node->nodeName)); Chris@0: } Chris@0: Chris@0: $this->value = ''; Chris@0: foreach ($this->node->childNodes as $node) { Chris@0: $this->value .= $node->wholeText; Chris@0: } Chris@0: } Chris@0: }