tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Form_Field

Source Location: /form/fields/form_field.class.php

Class Form_Field

Descendants
Child Class Description
Form_Field_File Represents HTML field type=file
Form_Field_Select Represents select field
Form_Field_Text Represents text field
Form_Field_Checkbox Represents HTML checkbox
Form_Field_Hidden Represents HTML field type="hiddne"
Form_Field_Date_Triad Represents 3 HTML text fields.
Form_Field_Radio_Group Represents group of radio buttons

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Property Summary
array   $current_errors   Array with current errors
mixed   $default_value   Default value
string   $html_value   HTML value of the field
string   $name   Name of the field
array   $potential_errors   Array with potential errors
boolean   $required   Is field required?
string   $type   Type of the field. Contains class name of the field object
mixed   $value   Value of the field

[ Top ]
Method Summary
Form_Field   __construct()   Constructor
void   accept_submit()   Accepts submit data
void   add_potential_error()   Adds potential error for the field
boolean   basic_check()   Performs basic check for validity
void   capture_submit()   Captures submit
void   clear_errors()   Clear current errors
mixed   get_default_value()   Returns default value
unknown   get_errors()   Return field's current errors
mixed   get_html_value()   Returns html_value
string   get_name()   Returns field name
string   get_potential_error()   Nonsense function. Candidate for removal
array   get_properties_array()   Returns array with field properties
unknown   get_required()   Returns if the field is required
string   get_type()   Returns type of the field (class name)
mixed   get_value()   Returns field's value
boolean   is_field_in_error()   Checks if field is in error
void   set_default_value()   Sets default value
void   set_error()   Sets field current error
void   set_html_value()   Sets html_value
void   set_name()   Sets field's name
void   set_required()   Sets will the field be required
void   set_to_default()   Set field's value to default value
void   set_value()   Sets field's value
void   translate_value_html2app()   Transfers data from html_value to value

[ Top ]
Properties
array   $current_errors = array() [line 86]

Array with current errors

API Tags:
Internal:  
Access:  private


[ Top ]
mixed   $default_value [line 65]

Default value

API Tags:
Internal:  
Access:  private


[ Top ]
string   $html_value [line 58]

HTML value of the field

API Tags:
Internal:  
Access:  private


[ Top ]
string   $name [line 37]

Name of the field

API Tags:
Internal:  
Access:  private


[ Top ]
array   $potential_errors = array() [line 79]

Array with potential errors

API Tags:
Internal:  
Access:  private


[ Top ]
boolean   $required [line 44]

Is field required?

API Tags:
Internal:  
Access:  private


[ Top ]
string   $type [line 72]

Type of the field. Contains class name of the field object

API Tags:
Internal:  
Access:  private


[ Top ]
mixed   $value [line 51]

Value of the field

API Tags:
Internal:  
Access:  private


[ Top ]
Methods
Constructor __construct  [line 96]

  Form_Field __construct( string $name, mixed $value, [boolean $required = false]  )

Constructor

Parameters:
string   $name:  Name of the field
mixed   $value:  Default value.
boolean   $required:  Is field required. Default is false


Redefined in descendants as:

[ Top ]
accept_submit  [line 250]

  void accept_submit( )

Accepts submit data


API Tags:
Internal:  
Access:  public


Redefined in descendants as:

[ Top ]
add_potential_error  [line 262]

  void add_potential_error( string $error_name  )

Adds potential error for the field

Parameters:
string   $error_name:  Name of the error

API Tags:
Access:  public


[ Top ]
basic_check  [line 216]

  boolean basic_check( )

Performs basic check for validity


API Tags:
Internal:  
Access:  public


Redefined in descendants as:

[ Top ]
capture_submit  [line 237]

  void capture_submit( string $form_name, &$submit_array, array $submit_array  )

Captures submit

Parameters:
string   $form_name: 
array   $submit_array: 
   &$submit_array: 

API Tags:
Internal:  
Access:  public


Redefined in descendants as:

[ Top ]
clear_errors  [line 343]

  void clear_errors( )

Clear current errors


API Tags:
Access:  public


[ Top ]
get_default_value  [line 196]

  mixed get_default_value( )

Returns default value


API Tags:
Access:  public


[ Top ]
get_errors  [line 334]

  unknown get_errors( )

Return field's current errors


API Tags:
Access:  public


[ Top ]
get_html_value  [line 372]

  mixed get_html_value( )

Returns html_value


API Tags:
Access:  public


[ Top ]
get_name  [line 127]

  string get_name( )

Returns field name


API Tags:
Access:  public


[ Top ]
get_potential_error  [line 306]

  string get_potential_error( string $error_name  )

Nonsense function. Candidate for removal

Parameters:
string   $error_name: 

API Tags:
Internal:  
Access:  public


[ Top ]
get_properties_array  [line 281]

  array get_properties_array( )

Returns array with field properties


API Tags:
Internal:  
Access:  public


Redefined in descendants as:

[ Top ]
get_required  [line 167]

  unknown get_required( )

Returns if the field is required


API Tags:
Access:  public


[ Top ]
get_type  [line 176]

  string get_type( )

Returns type of the field (class name)


API Tags:
Access:  public


[ Top ]
get_value  [line 147]

  mixed get_value( )

Returns field's value


API Tags:
Access:  public


[ Top ]
is_field_in_error  [line 383]

  boolean is_field_in_error( )

Checks if field is in error


API Tags:
Internal:  
Access:  protected


[ Top ]
set_default_value  [line 186]

  void set_default_value( mixed $default_value  )

Sets default value

Parameters:
mixed   $default_value: 

API Tags:
Access:  public


[ Top ]
set_error  [line 324]

  void set_error( string $potential_error_name  )

Sets field current error

Parameters:
string   $potential_error_name:  Name of the error

API Tags:
Access:  public


[ Top ]
set_html_value  [line 362]

  void set_html_value( mixed $html_value  )

Sets html_value

Parameters:
mixed   $html_value: 

API Tags:
Access:  protected


[ Top ]
set_name  [line 112]

  void set_name( string $name  )

Sets field's name

Parameters:
string   $name: 

API Tags:
Access:  protected


[ Top ]
set_required  [line 157]

  void set_required( boolean $required  )

Sets will the field be required

Parameters:
boolean   $required: 

API Tags:
Access:  public


[ Top ]
set_to_default  [line 205]

  void set_to_default( )

Set field's value to default value


API Tags:
Access:  public


[ Top ]
set_value  [line 137]

  void set_value( mixed $value  )

Sets field's value

Parameters:
mixed   $value: 

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
translate_value_html2app  [line 352]

  void translate_value_html2app( )

Transfers data from html_value to value


API Tags:
Internal:  
Access:  protected


Redefined in descendants as:

[ Top ]