Methods |
public
|
__construct(DOMElement $node, string|null $currentUri = null, string|null $method = null, string|null $baseHref = null)
Parameters
$node |
A \DOMElement instance
|
$currentUri |
The URI of the page where the form is embedded
|
$method |
The method to use for the link (if null, it defaults to the method defined by the form)
|
$baseHref |
The URI of the used for relative links, but not for empty action
|
Throws
Overrides
|
#
|
public
|
getFormNode(): DOMElement
Gets the form node associated with this form.
Gets the form node associated with this form.
|
#
|
public
|
setValues(array $values): $this
Sets the value of the fields.
Sets the value of the fields.
Parameters
$values |
An array of field values
|
|
#
|
public
|
getValues(): array
Gets the field values.
Gets the field values.
The returned array does not include file fields (@see getFiles).
|
#
|
public
|
getFiles(): array
Gets the file field values.
Gets the file field values.
|
#
|
public
|
getPhpValues(): array
Gets the field values as PHP.
Gets the field values as PHP.
This method converts fields with the array notation
(like foo[bar] to arrays) like PHP does.
|
#
|
public
|
getPhpFiles(): array
Gets the file field values as PHP.
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.
|
#
|
public
|
getUri(): string
Gets the URI of the form.
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.
Overrides
|
#
|
protected
|
getRawUri()
Returns raw URI data.
|
#
|
public
|
getMethod(): string
Gets the form method.
Gets the form method.
If no method is defined in the form, GET is returned.
Overrides
|
#
|
public
|
getName(): string
Gets the form name.
Gets the form name.
If no name is defined on the form, an empty string is returned.
|
#
|
public
|
has(string $name): bool
Returns true if the named field exists.
Returns true if the named field exists.
|
#
|
public
|
remove(string $name)
Removes a field from the form.
Removes a field from the form.
|
#
|
public
|
get(string $name): FormField|FormField[]|FormField[][]
Gets a named field.
|
#
|
public
|
set(FormField $field)
Sets a named field.
|
#
|
public
|
all(): FormField[]
Gets all fields.
|
#
|
public
|
offsetExists(string $name): bool
Returns true if the named field exists.
Returns true if the named field exists.
Parameters
Implements
|
#
|
public
|
offsetGet(string $name): FormField|FormField[]|FormField[][]
Gets the value of a field.
Gets the value of a field.
Parameters
Throws
Implements
|
#
|
public
|
offsetSet(string $name, string|array $value): void
Sets the value of a field.
Sets the value of a field.
Parameters
$name |
The field name
|
$value |
The value of the field
|
Throws
Implements
|
#
|
public
|
offsetUnset(string $name): void
Removes a field from the form.
Removes a field from the form.
Parameters
Implements
|
#
|
public
|
disableValidation(): $this
Disables validation.
|
#
|
protected
|
setNode(DOMElement $node)
Sets the node for the form.
Sets the node for the form.
Expects a 'submit' button \DOMElement and finds the corresponding form element, or the form element itself.
Parameters
$node |
A \DOMElement instance
|
Throws
LogicException |
If given node is not a button or input or does not have a form ancestor
|
Overrides
|
#
|