Class SimpleForm

Description

Form tag class to hold widget values.

Located in /libraries/pear/simpletest/tag.php (line 1021)


	
			
Variable Summary
 mixed $_action
 mixed $_buttons
 mixed $_id
 mixed $_images
 mixed $_method
 mixed $_widgets
Method Summary
 SimpleForm SimpleForm (SimpleTag $tag)
 void addWidget (SimpleWidget $tag)
 string getAction ()
 string getId ()
 string getMethod ()
 string getValue (string $name)
 string getValueById (string/integer $id)
 hash getValues ()
 boolean hasImageId (string $id)
 boolean hasImageLabel (string $label)
 boolean hasImageName (string $name)
 boolean hasSubmitId (string $id)
 boolean hasSubmitLabel (string $label)
 boolean hasSubmitName (string $name)
 boolean setField (string $name, string $value)
 boolean setFieldById (string/integer $id, string $value)
 hash submit ()
 hash submitButtonById (string $id)
 hash submitButtonByLabel (string $label)
 hash submitButtonByName (string $name)
 hash submitImageById (string/integer $id, integer $x, integer $y)
 hash submitImageByLabel (string $label, integer $x, integer $y)
 hash submitImageByName (string $name, integer $x, integer $y)
 void _setWidget (SimpleWidget $tag)
Variables
mixed $_action (line 1023)
mixed $_buttons (line 1025)
mixed $_id (line 1024)
mixed $_images (line 1026)
mixed $_method (line 1022)
mixed $_widgets (line 1027)
Methods
Constructor SimpleForm (line 1033)

Starts with no held controls/widgets.

SimpleForm SimpleForm (SimpleTag $tag)
addWidget (line 1074)

Adds a tag contents to the form.

  • access: public
void addWidget (SimpleWidget $tag)
getAction (line 1056)

Relative URL of the target.

  • return: URL target.
  • access: public
string getAction ()
getId (line 1065)

ID field of form for unique identification.

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

Accessor for form action.

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

Extracts current value from form.

  • return: Value as string or null if not set.
  • access: public
string getValue (string $name)
  • string $name: Keyed by widget name.
getValueById (line 1153)

Extracts current value from form by the ID.

  • return: Value as string or null if not set.
  • access: public
string getValueById (string/integer $id)
  • string/integer $id: Keyed by widget ID attribute.
getValues (line 1203)

Reads the current form values as a hash of submitted parameters. Repeated parameters appear as a list.

  • return: Submitted values.
  • access: public
hash getValues ()
hasImageId (line 1304)

Test to see if a form has a submittable image with this ID attribute.

  • return: True if present.
  • access: public
boolean hasImageId (string $id)
  • string $id: Button ID attribute to search for.
hasImageLabel (line 1272)

Test to see if a form has a submit button with this name attribute.

  • return: True if present.
  • access: public
boolean hasImageLabel (string $label)
  • string $label: Button alt attribute to search for or nearest equivalent.
hasImageName (line 1288)

Test to see if a form has a submittable image with this field name.

  • return: True if present.
  • access: public
boolean hasImageName (string $name)
  • string $name: Image name to search for.
hasSubmitId (line 1255)

Test to see if a form has a submit button with this ID attribute.

  • return: True if present.
  • access: public
boolean hasSubmitId (string $id)
  • string $id: Button ID attribute to search for.
hasSubmitLabel (line 1239)

Test to see if a form has a submit button with this value attribute.

  • return: True if present.
  • access: public
boolean hasSubmitLabel (string $label)
  • string $label: Button label to search for.
hasSubmitName (line 1223)

Test to see if a form has a submit button with this name attribute.

  • return: True if present.
  • access: public
boolean hasSubmitName (string $name)
  • string $name: Name to look for.
setField (line 1171)

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 (string $name, string $value)
  • string $name: Name of widget tag.
  • string $value: Value to input into the widget.
setFieldById (line 1187)

Sets a widget value within the form by using the ID.

  • return: True if value is legal, false otherwise. If the field is not present, nothing will be set.
  • access: public
boolean setFieldById (string/integer $id, string $value)
  • string/integer $id: Name of widget tag.
  • string $value: Value to input into the widget.
submit (line 1447)

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 ()
submitButtonById (line 1359)

Gets the submit values for a button identified by the ID.

  • return: Submitted values or false if there is no such button in the form.
  • access: public
hash submitButtonById (string $id)
  • string $id: Button ID attribute to search for.
submitButtonByLabel (line 1340)

Gets the submit values for a named button.

  • return: Submitted values or false if there is no such button in the form.
  • access: public
hash submitButtonByLabel (string $label)
  • string $label: Button label to search for.
submitButtonByName (line 1321)

Gets the submit values for a named button.

  • return: Submitted values or false if there is no such button in the form.
  • access: public
hash submitButtonByName (string $name)
  • string $name: Button label to search for.
submitImageById (line 1427)

Gets the submit values for an image identified by the ID.

  • return: Submitted values or false if there is no such button in the form.
  • access: public
hash submitImageById (string/integer $id, integer $x, integer $y)
  • string/integer $id: Button ID attribute to search for.
  • integer $x: X-coordinate of click.
  • integer $y: Y-coordinate of click.
submitImageByLabel (line 1381)

Gets the submit values for an image identified by the alt tag or nearest equivalent.

  • return: Submitted values or false if there is no such button in the form.
  • access: public
hash submitImageByLabel (string $label, integer $x, integer $y)
  • string $label: Button label to search for.
  • integer $x: X-coordinate of click.
  • integer $y: Y-coordinate of click.
submitImageByName (line 1404)

Gets the submit values for an image identified by the ID.

  • return: Submitted values or false if there is no such button in the form.
  • access: public
hash submitImageByName (string $name, integer $x, integer $y)
  • string $name: Image name to search for.
  • integer $x: X-coordinate of click.
  • integer $y: Y-coordinate of click.
_addCheckbox (line 1119)

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

  • access: private
void _addCheckbox (SimpleCheckboxTag $tag)
_addRadioButton (line 1107)

Adds a radio button, building a group if necessary.

  • access: private
void _addRadioButton (SimpleRadioButtonTag $tag)
_setWidget (line 1092)

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

  • access: private
void _setWidget (SimpleWidget $tag)

Documentation generated on Fri, 10 Dec 2004 18:26:35 +0000 by phpDocumentor 1.3.0RC3