Class SimpleForm

Description

Form tag class to hold widget values.

Located in /form.php (line 22)


	
			
Method Summary
 SimpleForm __construct (SimpleTag $tag, SimplePage $page)
 void addWidget (SimpleWidget $tag)
 void attachLabelBySelector (SimpleSelector $selector,  $label)
 SimpleUrl createAction (string $action,  $page, SimpleUrl $base)
 SimpleFormEncoding encode ()
 string getId ()
 string getMethod ()
 string/array getValue (SimpleSelector $selector)
 boolean hasImage (SimpleSelector $selector)
 boolean hasSubmit (SimpleSelector $selector)
 void setDefaultTarget (string $frame)
 string setEncodingClass (SimpleTag $tag)
 boolean setField (SimpleSelector $selector, string $value, [ $position = false])
 void setWidget (SimpleWidget $tag)
 hash submit ()
 SimpleEncoding submitButton (SimpleSelector $selector, [hash $additional = false])
 SimpleEncoding submitImage (SimpleSelector $selector, integer $x, integer $y, [hash $additional = false])
Methods
Constructor __construct (line 39)

Starts with no held controls/widgets.

SimpleForm __construct (SimpleTag $tag, SimplePage $page)
addCheckbox (line 188)

Adds a checkbox, making it a group on a repeated name.

  • access: protected
void addCheckbox (SimpleCheckboxTag $tag)
addRadioButton (line 175)

Adds a radio button, building a group if necessary.

  • access: protected
void addRadioButton (SimpleRadioButtonTag $tag)
addWidget (line 144)

Adds a tag contents to the form.

void addWidget (SimpleWidget $tag)
attachLabelBySelector (line 255)

Used by the page object to set widgets labels to external label tags.

  • access: public
void attachLabelBySelector (SimpleSelector $selector,  $label)
  • SimpleSelector $selector: Criteria to apply.
  • $label
createAction (line 93)

Combined action attribute with current location to get an absolute form target.

  • return: Absolute form target.
  • access: protected
SimpleUrl createAction (string $action,  $page, SimpleUrl $base)
  • string $action: Action attribute from form tag.
  • SimpleUrl $base: Page location.
  • $page
encode (line 122)

Creates the encoding for the current values in the form.

  • return: Request to submit.
  • access: protected
SimpleFormEncoding encode ()
getAction (line 105)

Absolute URL of the target.

  • return: URL target.
  • access: public
SimpleUrl getAction ()
getId (line 136)

ID field of form for unique identification.

  • return: Unique tag ID.
  • access: public
string getId ()
getMethod (line 82)

Accessor for method of form submission.

  • return: Either get or post.
  • access: public
string getMethod ()
getValue (line 210)

Extracts current value from form.

  • return: Value(s) as string or null if not set.
  • access: public
string/array getValue (SimpleSelector $selector)
  • SimpleSelector $selector: Criteria to apply.
hasImage (line 287)

Test to see if a form has an image control.

  • return: True if present.
  • access: public
boolean hasImage (SimpleSelector $selector)
  • SimpleSelector $selector: Criteria to apply.
hasSubmit (line 272)

Test to see if a form has a submit button.

  • return: True if present.
  • access: public
boolean hasSubmit (SimpleSelector $selector)
  • SimpleSelector $selector: Criteria to apply.
setDefaultTarget (line 73)

Sets the frame target within a frameset.

  • access: public
void setDefaultTarget (string $frame)
  • string $frame: Name of frame.
setEncodingClass (line 58)

Creates the request packet to be sent by the form.

  • return: Packet class.
  • access: protected
string setEncodingClass (SimpleTag $tag)
setField (line 233)

Sets a widget value within the form.

  • return: True if value is legal, false otherwise. If the field is not present, nothing will be set.
  • access: public
boolean setField (SimpleSelector $selector, string $value, [ $position = false])
  • SimpleSelector $selector: Criteria to apply.
  • string $value: Value to input into the widget.
  • $position
setWidget (line 160)

Sets the widget into the form, grouping radio buttons if any.

  • access: protected
void setWidget (SimpleWidget $tag)
submit (line 353)

Simply submits the form without the submit button value. Used when there is only one button or it is unimportant.

  • return: Submitted values.
  • access: public
hash submit ()
submitButton (line 305)

Gets the submit values for a selected button.

  • return: Submitted values or false if there is no such button in the form.
  • access: public
SimpleEncoding submitButton (SimpleSelector $selector, [hash $additional = false])
  • SimpleSelector $selector: Criteria to apply.
  • hash $additional: Additional data for the form.
submitImage (line 331)

Gets the submit values for an image.

  • return: Submitted values or false if there is no such button in the form.
  • access: public
SimpleEncoding submitImage (SimpleSelector $selector, integer $x, integer $y, [hash $additional = false])
  • SimpleSelector $selector: Criteria to apply.
  • integer $x: X-coordinate of click.
  • integer $y: Y-coordinate of click.
  • hash $additional: Additional data for the form.

Documentation generated on Sun, 31 Oct 2010 16:31:31 -0500 by phpDocumentor 1.4.3