function Form::getMethod
Gets the form method.
If no method is defined in the form, GET is returned.
Overrides AbstractUriElement::getMethod
2 calls to Form::getMethod()
- Form::getFiles in vendor/
symfony/ dom-crawler/ Form.php - Gets the file field values.
- Form::getUri in vendor/
symfony/ dom-crawler/ Form.php - Gets the URI of the form.
File
-
vendor/
symfony/ dom-crawler/ Form.php, line 215
Class
- Form
- Form represents an HTML form.
Namespace
Symfony\Component\DomCrawlerCode
public function getMethod() : string {
if (null !== $this->method) {
return $this->method;
}
// If the form was created from a button rather than the form node, check for HTML5 method override
if ($this->button !== $this->node && $this->button
->getAttribute('formmethod')) {
return strtoupper($this->button
->getAttribute('formmethod'));
}
return $this->node
->getAttribute('method') ? strtoupper($this->node
->getAttribute('method')) : 'GET';
}