Form
class Form extends Link implements ArrayAccess
Form represents an HTML form.
Properties
protected DOMElement | $node | from AbstractUriElement | |
protected string | $method | from AbstractUriElement | |
protected string | $currentUri | from AbstractUriElement |
Methods
No description
Gets the method associated with this link.
Gets the URI associated with this link.
Returns raw URI data.
Returns the canonicalized URI path (see RFC 3986, section 5.2.4).
Gets the form node associated with this form.
Sets the value of the fields.
Gets the field values.
Gets the file field values.
Gets the field values as PHP.
Gets the file field values as PHP.
Returns true if the named field exists.
Removes a field from the form.
Returns true if the named field exists.
Sets the value of a field.
Removes a field from the form.
Disables validation.
Details
__construct(DOMElement $node, string $currentUri, string|null $method = null, string $baseHref = null)
protected string
canonicalizePath(string $path)
Returns the canonicalized URI path (see RFC 3986, section 5.2.4).
array
getValues()
Gets the field values.
The returned array does not include file fields (see getFiles).
array
getPhpValues()
Gets the field values as PHP.
This method converts fields with the array notation (like foo[bar] to arrays) like PHP does.
array
getPhpFiles()
Gets the file field values as PHP.
This method converts fields with the array notation (like foo[bar] to arrays) like PHP does. The returned array is consistent with the array for field values (see getPhpValues), rather than uploaded files found in $_FILES. For a compound file field foo[bar] it will create foo[bar][name], instead of foo[name][bar] which would be found in $_FILES.