Form
class Form extends Link implements ArrayAccess
Form represents an HTML form.
Methods
Constructor.
Gets the form method.
Gets the URI of the form.
Gets the form node associated with this form.
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
at line line 49
__construct(DOMElement $node, string $currentUri, string $method = null, string $baseHref = null)
Constructor.
in Link at line line 61
DOMElement
getNode()
Gets the node associated with this link.
at line line 220
string
getMethod()
Gets the form method.
If no method is defined in the form, GET is returned.
at line line 187
string
getUri()
Gets the URI of the form.
The returned URI is not the same as the form "action" attribute. This method merges the value if the method is GET to mimics browser behavior.
at line line 62
DOMElement
getFormNode()
Gets the form node associated with this form.
at line line 74
Form
setValues(array $values)
Sets the value of the fields.
at line line 90
array
getValues()
Gets the field values.
The returned array does not include file fields (see getFiles).
at line line 111
array
getFiles()
Gets the file field values.
at line line 140
array
getPhpValues()
Gets the field values as PHP.
This method converts fields with the array notation (like foo[bar] to arrays) like PHP does.
at line line 163
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.
at line line 236
bool
has(string $name)
Returns true if the named field exists.
at line line 248
remove(string $name)
Removes a field from the form.
at line line 262
FormField
get(string $name)
Gets a named field.
at line line 272
set(FormField $field)
Sets a named field.
at line line 282
FormField[]
all()
Gets all fields.
at line line 294
bool
offsetExists(string $name)
Returns true if the named field exists.
at line line 308
FormField
offsetGet(string $name)
Gets the value of a field.
at line line 321
offsetSet(string $name, string|array $value)
Sets the value of a field.
at line line 331
offsetUnset(string $name)
Removes a field from the form.
at line line 341
Form
disableValidation()
Disables validation.