|
@@ -44,23 +44,6 @@ class Form extends Link implements \ArrayAccess
|
|
|
$this->initialize();
|
|
|
}
|
|
|
|
|
|
- protected function setNode(\DOMNode $node)
|
|
|
- {
|
|
|
- $this->button = $node;
|
|
|
- if ('button' == $node->nodeName || ('input' == $node->nodeName && in_array($node->getAttribute('type'), array('submit', 'button', 'image')))) {
|
|
|
- do {
|
|
|
- // use the ancestor form element
|
|
|
- if (null === $node = $node->parentNode) {
|
|
|
- throw new \LogicException('The selected node does not have a form ancestor.');
|
|
|
- }
|
|
|
- } while ('form' != $node->nodeName);
|
|
|
- } else {
|
|
|
- throw new \LogicException(sprintf('Unable to submit on a "%s" tag.', $node->nodeName));
|
|
|
- }
|
|
|
-
|
|
|
- $this->node = $node;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Gets the form node associated with this form.
|
|
|
*
|
|
@@ -380,4 +363,21 @@ class Form extends Link implements \ArrayAccess
|
|
|
{
|
|
|
$this->remove($name);
|
|
|
}
|
|
|
+
|
|
|
+ protected function setNode(\DOMNode $node)
|
|
|
+ {
|
|
|
+ $this->button = $node;
|
|
|
+ if ('button' == $node->nodeName || ('input' == $node->nodeName && in_array($node->getAttribute('type'), array('submit', 'button', 'image')))) {
|
|
|
+ do {
|
|
|
+ // use the ancestor form element
|
|
|
+ if (null === $node = $node->parentNode) {
|
|
|
+ throw new \LogicException('The selected node does not have a form ancestor.');
|
|
|
+ }
|
|
|
+ } while ('form' != $node->nodeName);
|
|
|
+ } else {
|
|
|
+ throw new \LogicException(sprintf('Unable to submit on a "%s" tag.', $node->nodeName));
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->node = $node;
|
|
|
+ }
|
|
|
}
|