255 lines
6 KiB
YAML
255 lines
6 KiB
YAML
name: Form
|
|
class_comment: '# * Form represents an HTML form.
|
|
|
|
# *
|
|
|
|
# * @author Fabien Potencier <fabien@symfony.com>'
|
|
dependencies:
|
|
- name: ChoiceFormField
|
|
type: class
|
|
source: Symfony\Component\DomCrawler\Field\ChoiceFormField
|
|
- name: FormField
|
|
type: class
|
|
source: Symfony\Component\DomCrawler\Field\FormField
|
|
properties: []
|
|
methods:
|
|
- name: __construct
|
|
visibility: public
|
|
parameters:
|
|
- name: node
|
|
- name: currentUri
|
|
default: 'null'
|
|
- name: method
|
|
default: 'null'
|
|
- name: baseHref
|
|
default: 'null'
|
|
comment: "# * Form represents an HTML form.\n# *\n# * @author Fabien Potencier <fabien@symfony.com>\n\
|
|
# */\n# class Form extends Link implements \\ArrayAccess\n# {\n# private \\DOMElement\
|
|
\ $button;\n# private FormFieldRegistry $fields;\n# \n# /**\n# * @param \\DOMElement\
|
|
\ $node A \\DOMElement instance\n# * @param string|null $currentUri The\
|
|
\ URI of the page where the form is embedded\n# * @param string|null $method \
|
|
\ The method to use for the link (if null, it defaults to the method defined\
|
|
\ by the form)\n# * @param string|null $baseHref The URI of the <base> used\
|
|
\ for relative links, but not for empty action\n# *\n# * @throws \\LogicException\
|
|
\ if the node is not a button inside a form tag"
|
|
- name: getFormNode
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * Gets the form node associated with this form.'
|
|
- name: setValues
|
|
visibility: public
|
|
parameters:
|
|
- name: values
|
|
comment: '# * Sets the value of the fields.
|
|
|
|
# *
|
|
|
|
# * @param array $values An array of field values
|
|
|
|
# *
|
|
|
|
# * @return $this'
|
|
- name: getValues
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * Gets the field values.
|
|
|
|
# *
|
|
|
|
# * The returned array does not include file fields (@see getFiles).'
|
|
- name: getFiles
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * Gets the file field values.'
|
|
- name: getPhpValues
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * Gets the field values as PHP.
|
|
|
|
# *
|
|
|
|
# * This method converts fields with the array notation
|
|
|
|
# * (like foo[bar] to arrays) like PHP does.'
|
|
- name: getPhpFiles
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * 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.'
|
|
- name: getUri
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * 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.'
|
|
- name: getRawUri
|
|
visibility: protected
|
|
parameters: []
|
|
comment: null
|
|
- name: getMethod
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * Gets the form method.
|
|
|
|
# *
|
|
|
|
# * If no method is defined in the form, GET is returned.'
|
|
- name: getName
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * Gets the form name.
|
|
|
|
# *
|
|
|
|
# * If no name is defined on the form, an empty string is returned.'
|
|
- name: has
|
|
visibility: public
|
|
parameters:
|
|
- name: name
|
|
comment: '# * Returns true if the named field exists.'
|
|
- name: remove
|
|
visibility: public
|
|
parameters:
|
|
- name: name
|
|
comment: '# * Removes a field from the form.'
|
|
- name: get
|
|
visibility: public
|
|
parameters:
|
|
- name: name
|
|
comment: '# * Gets a named field.
|
|
|
|
# *
|
|
|
|
# * @return FormField|FormField[]|FormField[][]
|
|
|
|
# *
|
|
|
|
# * @throws \InvalidArgumentException When field is not present in this form'
|
|
- name: set
|
|
visibility: public
|
|
parameters:
|
|
- name: field
|
|
comment: '# * Sets a named field.'
|
|
- name: all
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * Gets all fields.
|
|
|
|
# *
|
|
|
|
# * @return FormField[]'
|
|
- name: offsetExists
|
|
visibility: public
|
|
parameters:
|
|
- name: name
|
|
comment: '# * Returns true if the named field exists.
|
|
|
|
# *
|
|
|
|
# * @param string $name The field name'
|
|
- name: offsetGet
|
|
visibility: public
|
|
parameters:
|
|
- name: name
|
|
comment: '# * Gets the value of a field.
|
|
|
|
# *
|
|
|
|
# * @param string $name The field name
|
|
|
|
# *
|
|
|
|
# * @return FormField|FormField[]|FormField[][]
|
|
|
|
# *
|
|
|
|
# * @throws \InvalidArgumentException if the field does not exist'
|
|
- name: offsetSet
|
|
visibility: public
|
|
parameters:
|
|
- name: name
|
|
- name: value
|
|
comment: '# * Sets the value of a field.
|
|
|
|
# *
|
|
|
|
# * @param string $name The field name
|
|
|
|
# * @param string|array $value The value of the field
|
|
|
|
# *
|
|
|
|
# * @throws \InvalidArgumentException if the field does not exist'
|
|
- name: offsetUnset
|
|
visibility: public
|
|
parameters:
|
|
- name: name
|
|
comment: '# * Removes a field from the form.
|
|
|
|
# *
|
|
|
|
# * @param string $name The field name'
|
|
- name: disableValidation
|
|
visibility: public
|
|
parameters: []
|
|
comment: '# * Disables validation.
|
|
|
|
# *
|
|
|
|
# * @return $this'
|
|
- name: setNode
|
|
visibility: protected
|
|
parameters:
|
|
- name: node
|
|
comment: '# * Sets the node for the form.
|
|
|
|
# *
|
|
|
|
# * Expects a ''submit'' button \DOMElement and finds the corresponding form element,
|
|
or the form element itself.
|
|
|
|
# *
|
|
|
|
# * @throws \LogicException If given node is not a button or input or does not
|
|
have a form ancestor'
|
|
- name: initialize
|
|
visibility: private
|
|
parameters: []
|
|
comment: '# * Adds form elements related to this form.
|
|
|
|
# *
|
|
|
|
# * Creates an internal copy of the submitted ''button'' element and
|
|
|
|
# * the form node or the entire document depending on whether we need
|
|
|
|
# * to find non-descendant elements through HTML5 ''form'' attribute.'
|
|
- name: addField
|
|
visibility: private
|
|
parameters:
|
|
- name: node
|
|
comment: null
|
|
traits:
|
|
- Symfony\Component\DomCrawler\Field\ChoiceFormField
|
|
- Symfony\Component\DomCrawler\Field\FormField
|
|
interfaces:
|
|
- \ArrayAccess
|