Class Form

Description

Located in /form/Form.php (line 15)


	
			
Method Summary
Form_validator __construct ()
void addError (string $field, string $message)
void addField (string $name, [mixed $default_value = ''], [mixed $current_value = false])
void addFields (array $fields)
mixed cv (string $field, [boolean $escape = false])
boolean error ()
boolean fieldsMatch (string $field_1, string $field_2)
mixed getCurrentValue (string $field, [boolean $escape = false])
array getCurrentValues ()
mixed getDefaultValue (string $field, [boolean $escape = true])
array getErrors ()
boolean isAlnum (string $field)
boolean isAlpha (string $field)
boolean isCreditCard (string $field, string $type)
boolean isCurrency (feild $field)
boolean isDate (string $field, string $type)
boolean isEmail (string $field)
boolean isFilled (string $field)
boolean isFloat (string $field)
boolean isInt (string $field)
boolean isIp (string $field)
boolean isPhoneNumber ( $field, [string $country = 'US'], string $phonenumber)
boolean isSubmitted ([string $method = 'post'], [strong $field = false])
void loadGET ()
void loadIncomingValues ([ $method = 'post'])
void loadPOST ()
void loadRecord (string $table, [integer $id = false], [string $field = false])
array loadSingleValues ([ $param_type = 'get'],  $fields)
void loadTable ([string $table = false])
void printErrors ()
void resetDefaults ()
integer save ([integer $id = false])
void setCurrentValue ([string $field = false], [mixed $value = false])
void setDefaultValue ([string $field = false], [mixed $value = false])
Methods
Constructor __construct (line 66)
  • abstract: Contrucor, obtains an instance of the original app
  • access: public
Form_validator __construct ()
addError (line 443)
  • abstract: Triggers a validation error message
  • access: public
void addError (string $field, string $message)
  • string $field
  • string $message
addField (line 203)
  • abstract: Adds a new field to our form schema
  • access: public
void addField (string $name, [mixed $default_value = ''], [mixed $current_value = false])
  • string $name
  • mixed $default_value
  • mixed $current_value
addFields (line 218)
  • abstract: Adds each item in an array as a field
  • access: public
void addFields (array $fields)
  • array $fields
cv (line 296)
  • abstract: Returns the current value for a field
  • access: public
mixed cv (string $field, [boolean $escape = false])
  • string $field
  • boolean $escape
error (line 490)
  • abstract: Returns a boolean whether there is an error or not
  • access: public
boolean error ()
fieldsMatch (line 519)
  • abstract: Compares two field values
  • access: public
boolean fieldsMatch (string $field_1, string $field_2)
  • string $field_1
  • string $field_2
getCurrentValue (line 308)
  • abstract: Returns the current value for a field
  • access: public
mixed getCurrentValue (string $field, [boolean $escape = false])
  • string $field
  • boolean $escape
getCurrentValues (line 328)
  • abstract: Returns an array of all fields and their current values
  • access: public
array getCurrentValues ()
getDefaultValue (line 248)
  • abstract: Returns the default value for a field
  • access: public
mixed getDefaultValue (string $field, [boolean $escape = true])
  • string $field
  • boolean $escape
getErrors (line 460)
  • abstract: Returns an array of current form errors
  • access: public
array getErrors ()
isAlnum (line 552)
  • abstract: Checks for an alphanumeric string
  • access: public
boolean isAlnum (string $field)
  • string $field
isAlpha (line 563)
  • abstract: Checks for an alpha string
  • access: public
boolean isAlpha (string $field)
  • string $field
isCreditCard (line 586)
  • abstract: Checks whether or not the string is a credit card number
  • access: public
boolean isCreditCard (string $field, string $type)
  • string $field
  • string $type
isCurrency (line 620)
  • abstract: Checks for a valid float/digit
  • access: public
boolean isCurrency (feild $field)
  • feild $field
isDate (line 598)
  • abstract: Checks whether or not the string is a valid date
  • access: public
boolean isDate (string $field, string $type)
  • string $field
  • string $type
isEmail (line 609)
  • abstract: Checks for a valid email format
  • access: public
boolean isEmail (string $field)
  • string $field
isFilled (line 506)
  • abstract: Checks a form field for content
  • access: public
boolean isFilled (string $field)
  • string $field
isFloat (line 541)
  • abstract: Checks for a float value
  • access: public
boolean isFloat (string $field)
  • string $field
isInt (line 530)
  • abstract: Checks for an integer
  • access: public
boolean isInt (string $field)
  • string $field
isIp (line 574)
  • abstract: Checks for an IP address
  • access: public
boolean isIp (string $field)
  • string $field
isPhoneNumber (line 633)
  • abstract: Checks for a valid phone number
  • access: public
boolean isPhoneNumber ( $field, [string $country = 'US'], string $phonenumber)
  • string $phonenumber
  • string $country
  • $field
isSubmitted (line 156)
  • abstract: Determines whether or not a form has been submitted
  • access: public
boolean isSubmitted ([string $method = 'post'], [strong $field = false])
  • string $method
  • strong $field
loadGET (line 357)
  • abstract: Imports all values for current fields from GET data
  • access: public
void loadGET ()
loadIncomingValues (line 366)
  • abstract: Imports all values for current fields from incoming GET/POST data
  • access: public
void loadIncomingValues ([ $method = 'post'])
  • $method
loadPOST (line 348)
  • abstract: Imports all values for current fields from POST data
  • access: public
void loadPOST ()
loadRecord (line 100)
  • abstract: Loads a single record - field names and values
  • access: public
void loadRecord (string $table, [integer $id = false], [string $field = false])
  • string $table
  • integer $id
  • string $field
loadSingleValues (line 422)
  • abstract: Loads in values straight from get/post from an array of field names
  • access: public
array loadSingleValues ([ $param_type = 'get'],  $fields)
  • $param_type
  • $fields
loadTable (line 74)
  • abstract: Loads a table's fields and it's schema
  • access: public
void loadTable ([string $table = false])
  • string $table
printErrors (line 469)
  • abstract: Prints out form error messages using html wrapping defined in config
  • access: public
void printErrors ()
resetDefaults (line 266)
  • abstract: Resets all form fields to their default values
  • access: public
void resetDefaults ()
save (line 136)
  • abstract: Initiates the insert/update queries on form data
  • access: public
integer save ([integer $id = false])
  • integer $id
setCurrentValue (line 281)
  • abstract: Sets the current value of a form field
  • access: public
void setCurrentValue ([string $field = false], [mixed $value = false])
  • string $field
  • mixed $value
setDefaultValue (line 233)
  • abstract: Sets a default value of a form field
  • access: public
void setDefaultValue ([string $field = false], [mixed $value = false])
  • string $field
  • mixed $value

Documentation generated on Wed, 15 Apr 2009 17:03:40 -0700 by phpDocumentor 1.4.1