PHP 클래스 Symfony\Component\DomCrawler\Form

저자: Fabien Potencier ([email protected])
상속: extends Symfony\Component\DomCrawler\Link, implements ArrayAccess
파일 보기 프로젝트 열기: symfony/symfony 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( DOMElement $node, string $currentUri, string $method = null, string $baseHref = null ) Constructor.
all ( ) : FormField[] Gets all fields.
disableValidation ( ) : self Disables validation.
get ( string $name ) : FormField Gets a named field.
getFiles ( ) : array Gets the file field values.
getFormNode ( ) : DOMElement Gets the form node associated with this form.
getMethod ( ) : string Gets the form method.
getPhpFiles ( ) : array Gets the file field values as PHP.
getPhpValues ( ) : array Gets the field values as PHP.
getUri ( ) : string Gets the URI of the form.
getValues ( ) : array Gets the field values.
has ( string $name ) : boolean Returns true if the named field exists.
offsetExists ( string $name ) : boolean Returns true if the named field exists.
offsetGet ( string $name ) : FormField Gets the value of a field.
offsetSet ( string $name, string | array $value ) Sets the value of a field.
offsetUnset ( string $name ) Removes a field from the form.
remove ( string $name ) Removes a field from the form.
set ( FormField $field ) Sets a named field.
setValues ( array $values ) : Form Sets the value of the fields.

보호된 메소드들

메소드 설명
getRawUri ( )
setNode ( DOMElement $node ) Sets the node for the form.

비공개 메소드들

메소드 설명
addField ( DOMElement $node )
initialize ( ) Adds form elements related to this form.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( DOMElement $node, string $currentUri, string $method = null, string $baseHref = null )
$node DOMElement A \DOMElement instance
$currentUri string The URI of the page where the form is embedded
$method string The method to use for the link (if null, it defaults to the method defined by the form)
$baseHref string The URI of the used for relative links, but not for empty action

all() 공개 메소드

Gets all fields.
public all ( ) : FormField[]
리턴 Symfony\Component\DomCrawler\Field\FormField[] An array of fields

disableValidation() 공개 메소드

Disables validation.
public disableValidation ( ) : self
리턴 self

get() 공개 메소드

Gets a named field.
public get ( string $name ) : FormField
$name string The field name
리턴 Symfony\Component\DomCrawler\Field\FormField The field instance

getFiles() 공개 메소드

Gets the file field values.
public getFiles ( ) : array
리턴 array An array of file field values

getFormNode() 공개 메소드

Gets the form node associated with this form.
public getFormNode ( ) : DOMElement
리턴 DOMElement A \DOMElement instance

getMethod() 공개 메소드

If no method is defined in the form, GET is returned.
public getMethod ( ) : string
리턴 string The method

getPhpFiles() 공개 메소드

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 getPhpFiles ( ) : array
리턴 array An array of file field values

getPhpValues() 공개 메소드

This method converts fields with the array notation (like foo[bar] to arrays) like PHP does.
public getPhpValues ( ) : array
리턴 array An array of field values

getRawUri() 보호된 메소드

protected getRawUri ( )

getUri() 공개 메소드

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.
public getUri ( ) : string
리턴 string The URI

getValues() 공개 메소드

The returned array does not include file fields (@see getFiles).
public getValues ( ) : array
리턴 array An array of field values

has() 공개 메소드

Returns true if the named field exists.
public has ( string $name ) : boolean
$name string The field name
리턴 boolean true if the field exists, false otherwise

offsetExists() 공개 메소드

Returns true if the named field exists.
public offsetExists ( string $name ) : boolean
$name string The field name
리턴 boolean true if the field exists, false otherwise

offsetGet() 공개 메소드

Gets the value of a field.
public offsetGet ( string $name ) : FormField
$name string The field name
리턴 Symfony\Component\DomCrawler\Field\FormField The associated Field instance

offsetSet() 공개 메소드

Sets the value of a field.
public offsetSet ( string $name, string | array $value )
$name string The field name
$value string | array The value of the field

offsetUnset() 공개 메소드

Removes a field from the form.
public offsetUnset ( string $name )
$name string The field name

remove() 공개 메소드

Removes a field from the form.
public remove ( string $name )
$name string The field name

set() 공개 메소드

Sets a named field.
public set ( FormField $field )
$field Symfony\Component\DomCrawler\Field\FormField The field

setNode() 보호된 메소드

Expects a 'submit' button \DOMElement and finds the corresponding form element, or the form element itself.
protected setNode ( DOMElement $node )
$node DOMElement A \DOMElement instance

setValues() 공개 메소드

Sets the value of the fields.
public setValues ( array $values ) : Form
$values array An array of field values
리턴 Form