PHP 클래스 SimpleForm, simpletest

파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( SimpleTag $tag, SimplePage $page ) Starts with no held controls/widgets.
addWidget ( SimpleWidget $tag ) Adds a tag contents to the form.
attachLabelBySelector ( SelectorInterface $selector, $label ) Used by the page object to set widgets labels to external label tags.
getAction ( ) : SimpleUrl Absolute URL of the target.
getId ( ) : string ID field of form for unique identification.
getMethod ( ) : string Accessor for method of form submission.
getValue ( SelectorInterface $selector ) : string/array Extracts current value from form.
hasImage ( SelectorInterface $selector ) : boolean Test to see if a form has an image control.
hasSubmit ( SelectorInterface $selector ) : boolean Test to see if a form has a submit button.
setDefaultTarget ( string $frame ) Sets the frame target within a frameset.
setField ( SelectorInterface $selector, string $value, $position = false ) : boolean Sets a widget value within the form.
submit ( $additional = false ) : hash Simply submits the form without the submit button value.
submitButton ( SelectorInterface $selector, hash $additional = false ) : SimpleEncoding Gets the submit values for a selected button.
submitImage ( SelectorInterface $selector, integer $x, integer $y, hash $additional = false ) : SimpleEncoding Gets the submit values for an image.

보호된 메소드들

메소드 설명
addCheckbox ( SimpleCheckboxTag $tag ) Adds a checkbox, making it a group on a repeated name.
addRadioButton ( SimpleRadioButtonTag $tag ) Adds a radio button, building a group if necessary.
createAction ( string $action, $page ) : SimpleUrl Combined action attribute with current location to get an absolute form target.
encode ( ) : SimpleFormEncoding Creates the encoding for the current values in the form.
setEncodingClass ( SimpleTag $tag ) : string Creates the request packet to be sent by the form.
setWidget ( SimpleWidget $tag ) Sets the widget into the form, grouping radio buttons if any.

메소드 상세

__construct() 공개 메소드

Starts with no held controls/widgets.
public __construct ( SimpleTag $tag, SimplePage $page )
$tag SimpleTag Form tag to read.
$page SimplePage Holding page.

addCheckbox() 보호된 메소드

Adds a checkbox, making it a group on a repeated name.
protected addCheckbox ( SimpleCheckboxTag $tag )
$tag SimpleCheckboxTag Incoming form control.

addRadioButton() 보호된 메소드

Adds a radio button, building a group if necessary.
protected addRadioButton ( SimpleRadioButtonTag $tag )
$tag SimpleRadioButtonTag Incoming form control.

addWidget() 공개 메소드

Adds a tag contents to the form.
public addWidget ( SimpleWidget $tag )
$tag SimpleWidget Input tag to add.

attachLabelBySelector() 공개 메소드

Used by the page object to set widgets labels to external label tags.
public attachLabelBySelector ( SelectorInterface $selector, $label )
$selector SelectorInterface Criteria to apply.

createAction() 보호된 메소드

Combined action attribute with current location to get an absolute form target.
protected createAction ( string $action, $page ) : SimpleUrl
$action string Action attribute from form tag.
$page Page location.
리턴 SimpleUrl Absolute form target.

encode() 보호된 메소드

Creates the encoding for the current values in the form.
protected encode ( ) : SimpleFormEncoding
리턴 SimpleFormEncoding Request to submit.

getAction() 공개 메소드

Absolute URL of the target.
public getAction ( ) : SimpleUrl
리턴 SimpleUrl URL target.

getId() 공개 메소드

ID field of form for unique identification.
public getId ( ) : string
리턴 string Unique tag ID.

getMethod() 공개 메소드

Accessor for method of form submission.
public getMethod ( ) : string
리턴 string Either get or post.

getValue() 공개 메소드

Extracts current value from form.
public getValue ( SelectorInterface $selector ) : string/array
$selector SelectorInterface Criteria to apply.
리턴 string/array

hasImage() 공개 메소드

Test to see if a form has an image control.
public hasImage ( SelectorInterface $selector ) : boolean
$selector SelectorInterface Criteria to apply.
리턴 boolean True if present.

hasSubmit() 공개 메소드

Test to see if a form has a submit button.
public hasSubmit ( SelectorInterface $selector ) : boolean
$selector SelectorInterface Criteria to apply.
리턴 boolean True if present.

setDefaultTarget() 공개 메소드

Sets the frame target within a frameset.
public setDefaultTarget ( string $frame )
$frame string Name of frame.

setEncodingClass() 보호된 메소드

Creates the request packet to be sent by the form.
protected setEncodingClass ( SimpleTag $tag ) : string
$tag SimpleTag Form tag to read.
리턴 string Packet class.

setField() 공개 메소드

Sets a widget value within the form.
public setField ( SelectorInterface $selector, string $value, $position = false ) : boolean
$selector SelectorInterface Criteria to apply.
$value string Value to input into the widget.
리턴 boolean True if value is legal, false otherwise. If the field is not present, nothing will be set.

setWidget() 보호된 메소드

Sets the widget into the form, grouping radio buttons if any.
protected setWidget ( SimpleWidget $tag )
$tag SimpleWidget Incoming form control.

submit() 공개 메소드

Used when there is only one button or it is unimportant.
public submit ( $additional = false ) : hash
리턴 hash Submitted values.

submitButton() 공개 메소드

Gets the submit values for a selected button.
public submitButton ( SelectorInterface $selector, hash $additional = false ) : SimpleEncoding
$selector SelectorInterface Criteria to apply.
$additional hash Additional data for the form.
리턴 SimpleEncoding Submitted values or false if there is no such button in the form.

submitImage() 공개 메소드

Gets the submit values for an image.
public submitImage ( SelectorInterface $selector, integer $x, integer $y, hash $additional = false ) : SimpleEncoding
$selector SelectorInterface Criteria to apply.
$x integer X-coordinate of click.
$y integer Y-coordinate of click.
$additional hash Additional data for the form.
리턴 SimpleEncoding Submitted values or false if there is no such button in the form.