tina_mvc/helpers/tina_mvc_form_helper_class.php

Show: PublicProtectedPrivateinherited
Table of Contents
Form Helper class file

Builds a form, checks and validates $_POST and $_GET variables and generates HTML for you

Package
Tina-MVC  
Subpackage
Core  

\TINA_MVC\field

Package: Tina-MVC\Docs
The field class
Parent(s)
\TINA_MVC\form_base

Properties

>VPropertyprotectedmixed $caption
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $db_field
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $db_table
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $default_value
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertypublicbool $do_xml = TRUE
inherited
Whether or not to use XML short tags
Inherited from: \TINA_MVC\form_base::$$do_xml
Default valueTRUEDetails
Type
bool
Inherited_from
\TINA_MVC\form_base::$$do_xml  
>VPropertyprotectedmixed $extra_attribs
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertypublicobject $form
The form object this field belongs to
Details
Type
object
>VPropertypublicstring $html_form = '<div class="tina_mvc_form">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form

Use sprintf() format.

Default value'<div class="tina_mvc_form">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form  
>VPropertypublicstring $html_form_button = '<div class="tina_mvc_form_button">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_button

Use sprintf() format.

Default value'<div class="tina_mvc_form_button">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_button  
>VPropertypublicstring $html_form_error = '<div class="tina_mvc_form_error_message">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_error

Use sprintf() format.

Default value'<div class="tina_mvc_form_error_message">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_error  
>VPropertypublicstring $html_form_field_error = '<span class="tina_mvc_error">%s </span>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_field_error

Use sprintf() format.

Default value'<span class="tina_mvc_error">%s </span>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_field_error  
>VPropertypublicstring $html_form_field_message = '<div class="tina_mvc_form_field_message">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_field_message

Use sprintf() format.

Default value'<div class="tina_mvc_form_field_message">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_field_message  
>VPropertypublicstring $html_form_input = '<span class="tina_mvc_form_input">%s</span>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_input

Use sprintf() format.

Default value'<span class="tina_mvc_form_input">%s</span>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_input  
>VPropertypublicstring $html_form_label = '<span class="tina_mvc_form_label">%s </span>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_label

Use sprintf() format.

Default value'<span class="tina_mvc_form_label">%s </span>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_label  
>VPropertypublicstring $html_form_message = '<div class="tina_mvc_form_message">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_message

Use sprintf() format.

Default value'<div class="tina_mvc_form_message">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_message  
>VPropertypublicstring $html_form_messages = '<div class="tina_mvc_form_messages">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_messages

Use sprintf() format.

Default value'<div class="tina_mvc_form_messages">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_messages  
>VPropertypublicstring $html_form_pair = '<div class="tina_mvc_form_pair">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_pair

Use sprintf() format.

Default value'<div class="tina_mvc_form_pair">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_pair  
>VPropertypublicstring $html_form_radio_set = '<span class="tina_mvc_form_radio_set">%s</span>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_radio_set

Use sprintf() format.

Default value'<span class="tina_mvc_form_radio_set">%s</span>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_radio_set  
>VPropertypublicstring $html_form_required_after_input = ' (required) '
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_required_after_input

Use sprintf() format.

Default value' (required) 'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_required_after_input  
>VPropertypublicstring $html_form_required_after_label = ''
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_required_after_label

Use sprintf() format.

Default value''Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_required_after_label  
>VPropertyprotectedmixed $map_height
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $map_width
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $name
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $options
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $posted_value
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $protected
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $set_value
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $type
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedmixed $validation_errors
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed
>VPropertyprotectedarray $validation_rules = array()
inherited
Validation rules
Inherited from: \TINA_MVC\form_base::$$validation_rules
Default valuearray()Details
Type
array
Inherited_from
\TINA_MVC\form_base::$$validation_rules  
>VPropertyprotectedmixed $value
All variables should be accessed using setters and getters.

Direct access is not supported.

Details
Type
mixed

Methods

methodpublic__construct(object $form, String $name = '', String $type = '', String $caption = '', String $db_table = '', String $db_field = '', String $default_value = '', mixed $extra_attribs = '', boolean $protected = FALSE) : object

Sets up the field

Parameters
NameTypeDescription
$formobject

The form object the field is part of

$nameString

A name (alphanumeric plus underscore only)

$typeString

See the field_* classes for valid field types. You can also check the test_form_controller.php file in the samples folder

$captionString

Field caption used in a label (default caption is based on the name of the field)

$db_tableString

Used to group fields

$db_fieldString

If the database is different from the field name for some reason you can set it here.

$default_valueString
$extra_attribsmixed

a string or array of strings

$protectedboolean

Prevent load_data() from overwriting values in this field

Returns
TypeDescription
objectfield
methodpublicadd_validation(mixed $rules = FALSE) : object

Adds validation rule(s) to a field

Parameters
NameTypeDescription
$rulesmixed

A single rule ( array( 'rule_name' => 'rule_parameters'.... ). See validate_* classes for valid rules.

Returns
TypeDescription
objectfield
methodpublicadd_validation_error(string $message) : object

Adds a validation error message to a field

Parameters
NameTypeDescription
$messagestring
Returns
TypeDescription
objectfield
methodprivatecheck_validation_rule(string $v) : mixed

Checks a validation rule exists

Parameters
NameTypeDescription
$vstring
Returns
TypeDescription
mixed
methodpublicget_caption() : string

Getter

Returns
TypeDescription
string
methodpublicget_db_field() : string

Getter

Returns
TypeDescription
string
methodpublicget_db_table() : string

Getter

Returns
TypeDescription
string
methodpublicget_error_count() : integer

Gets the number of validation errors on a field

Returns
TypeDescription
integer
methodpublicget_extra_attribs() : string
inherited

Getter

Inherited from: \TINA_MVC\form_base::get_extra_attribs()
Returns
TypeDescription
string
methodpublicget_id() : string

Getter

Returns
TypeDescription
string
methodpublicget_map_height() : string

Getter

Returns
TypeDescription
string
methodpublicget_map_width() : string

Getter

Returns
TypeDescription
string
methodpublicget_name() : String
inherited

Gets the field or form name

Inherited from: \TINA_MVC\form_base::get_name()
Returns
TypeDescription
String
methodpublicget_options() : mixed

Gets the options for a radio or select field

Returns
TypeDescription
mixed
methodpublicget_post_var_name() : string

Gets the POST/GET variable name used in HTML

Returns
TypeDescription
string
methodpublicget_value() : mixed

Getter

Gets the posted value, set value or default value (in that order)

Returns
TypeDescription
mixed
methodpublicget_xhtml_slash() : String
inherited

Returns a XML slash for self closing tags

Inherited from: \TINA_MVC\form_base::get_xhtml_slash()
Returns
TypeDescription
String
methodpublicis_protected() : boolean

Checks if a fields value is protected and shouldn't be changed by a user

Returns
TypeDescription
boolean
methodpublicrender() : string

Renders the field

Returns
TypeDescription
stringescaped HTML
methodpublicrender_label() : string

Renders a label for a field

Returns
TypeDescription
stringescaped HTML
methodpublicset_caption(string $caption = '') : object

Set the caption for an input field

Parameters
NameTypeDescription
$captionstring
Returns
TypeDescription
objectfield
methodpublicset_db_field(string $field_name = '') : object

Sets the database field name (if different from the field name)

Parameters
NameTypeDescription
$field_namestring
Returns
TypeDescription
objectfield
methodpublicset_db_table(string $table_name = '') : object

Sets the db_table value for a field

Allows fields with the same db_table value to be retrieved together

Parameters
NameTypeDescription
$table_namestring
Returns
TypeDescription
objectfield
methodpublicset_default_value(mixed $value = FALSE) : object

Sets the default value for a field

Parameters
NameTypeDescription
$valuemixed
Returns
TypeDescription
objectfield
methodpublicset_extra_attribs(mixed $attribs = FALSE) : object
inherited

Sets any extra attributes you wish to pass to the form or field

Inherited from: \TINA_MVC\form_base::set_extra_attribs()
Parameters
NameTypeDescription
$attribsmixed

An array of attribs or a string to be added directly into the element e.g. 'attrib="value"'

Returns
TypeDescription
object
methodprivateset_form(object $form_object) : object

Sets the form the field belongs to

Parameters
NameTypeDescription
$form_objectobject
Returns
TypeDescription
objectfield
methodpublicset_map_height(string $h) : void

Sets the map height for field type GOOGLEMAP

Parameters
NameTypeDescription
$hstring

a valid css height

methodpublicset_map_width(string $w) : void

Sets the map width for field type GOOGLEMAP

Parameters
NameTypeDescription
$wstring

a valid css width

methodpublicset_name(String $name = '') : object
inherited

Checks the name for the form or field element

Inherited from: \TINA_MVC\form_base::set_name()
Parameters
NameTypeDescription
$nameString

The name

Returns
TypeDescription
object
methodpublicset_options(array $options = array()) : object

Sets options for select and radio field types

Options are array( array( 'post_value' , 'display_value' ) ). This allows feeding an array of array( 'id'=>'name' ) from a database query for example.

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
objectfield
methodpublicset_posted_value(mixed $value = FALSE) : object

Sets a posted value for the field.

Overrides the set value

Parameters
NameTypeDescription
$valuemixed
Returns
TypeDescription
objectfield
methodpublicset_set_value(mixed $value = FALSE) : object

Sets a value for the field.

Overrides the default value

Parameters
NameTypeDescription
$valuemixed
Returns
TypeDescription
objectfield
methodpublicset_type(string $t) : object

Sets the field type

Parameters
NameTypeDescription
$tstring

See field_* classes for valid field types

Returns
TypeDescription
objectfield
methodpublicset_value(mixed $value = FALSE) : object

Sets a value for the field

Parameters
NameTypeDescription
$valuemixed
Returns
TypeDescription
objectfield
methodpublicvalidate() : boolean

Runs validation rules on a field

Returns
TypeDescription
boolean

\TINA_MVC\field_checkbox

Package: Tina-MVC\Core
Renderer for INPUT type 'checkbox'
See
object  

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_fieldset_close

Package: Tina-MVC\Core
Renderer for INPUT type 'fieldset_close'
See
object  

Properties

>VPropertypublic$no_html_wrappers = TRUE
Set as TRUE to prevent the render function from wrapping the output within a form pair html block.

See $form_base->html_form_pair

Default valueTRUEDetails
Type
n/a

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_fieldset_open

Package: Tina-MVC\Core
Renderer for INPUT type 'fieldset_open'
See
object  

Properties

>VPropertypublic$no_html_wrappers = TRUE
Set as TRUE to prevent the render function from wrapping the output within a form pair html block.

See $form_base->html_form_pair

Default valueTRUEDetails
Type
n/a

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_googlemap

Package: Tina-MVC\Core
Renderer for INPUT type 'googlemap'

The 'value' for a Googlemap is "latitude,longitude,zoom"

See
object  

Properties

>VPropertypublic$failsafe_location_default = '53.3406,-6.2752,6'
In case the default is not set in the app_settings.php file
Default value'53.3406,-6.2752,6'Details
Type
n/a

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_hidden

Package: Tina-MVC\Core
Renderer for INPUT type 'hidden'
See
object  

Properties

>VPropertypublicboolean $render_label = FALSE
Prevents the label from being generated
Default valueFALSEDetails
Type
boolean

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_password

Package: Tina-MVC\Core
Renderer for INPUT type 'password'
See
object  

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_radio

Package: Tina-MVC\Core
Renderer for INPUT type 'radio'
See
object  

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_recaptcha

Package: Tina-MVC\Core
Renderer for INPUT type 'recaptcha'
See
object  
See
\TINA_MVC\http://recaptcha.net  

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string
methodpublicsetup(object $f) : void

The setup function can be used to perform setup actions on a field.

In this case we are using it to include library files and add a validation rule

Parameters
NameTypeDescription
$fobject

field

\TINA_MVC\field_reset

Package: Tina-MVC\Core
Renderer for INPUT type 'reset'

Note that this does not reset reCaptcha fields.

See
object  

Properties

>VPropertypublic$render_label = FALSE
Prevents a label from being generated for this element
Default valueFALSEDetails
Type
n/a
See
field_text->render_label  

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_select

Package: Tina-MVC\Core
Renderer for INPUT type 'select'
See
object  

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_submit

Package: Tina-MVC\Core
Renderer for INPUT type 'submit'
See
object  

Properties

>VPropertypublic$render_label = FALSE
Prevents a label from being generated for this element
Default valueFALSEDetails
Type
n/a
See
field_text->render_label  

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_text

Package: Tina-MVC\Core
Renderer for INPUT type 'text'

You can extend the form helper by using these classes as an example. You must define a html() function which returns the escaped HTML required to display the element. Look at field_googlemap or field_recaptcha for an example of a more complex field type.

You can also define a function setup() which accepts the field object as a parameter. See field_recaptcha to see how this works.

Properties

>VPropertypublic$render_label = TRUE
Set FALSE to prevent a LABEL element being generated before this element.

If not defined $render_label is assumed TRUE

Default valueTRUEDetails
Type
n/a

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_textarea

Package: Tina-MVC\Core
Renderer for INPUT type 'textarea'
See
object  

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\field_textblock

Package: Tina-MVC\Core
Renderer for INPUT type 'textblock'
See
object  

Properties

>VPropertypublic$plain_html = TRUE
Set as TRUE to prevent the render function from trying to render a label/input pair.

The output will be within the form pair html block. See $form_base->html_form_pair

Default valueTRUEDetails
Type
n/a

Methods

methodpublichtml(object $f) : string

Generates the HTML to display this element

Parameters
NameTypeDescription
$fobject

the field object

Returns
TypeDescription
string

\TINA_MVC\form

Package: Tina-MVC\Docs
The form class
Parent(s)
\TINA_MVC\form_base

Properties

>VPropertyprotectedmixed $action
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertypublicbool $do_xml = TRUE
inherited
Whether or not to use XML short tags
Inherited from: \TINA_MVC\form_base::$$do_xml
Default valueTRUEDetails
Type
bool
Inherited_from
\TINA_MVC\form_base::$$do_xml  
>VPropertyprotectedmixed $enctype
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertyprotectedmixed $error_messages
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertyprotectedmixed $fields
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertyprotectedmixed $fieldset_open
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertyprotectedmixed $form_posted
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertypublicstring $html_form = '<div class="tina_mvc_form">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form

Use sprintf() format.

Default value'<div class="tina_mvc_form">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form  
>VPropertypublicstring $html_form_button = '<div class="tina_mvc_form_button">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_button

Use sprintf() format.

Default value'<div class="tina_mvc_form_button">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_button  
>VPropertypublicstring $html_form_error = '<div class="tina_mvc_form_error_message">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_error

Use sprintf() format.

Default value'<div class="tina_mvc_form_error_message">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_error  
>VPropertypublicstring $html_form_field_error = '<span class="tina_mvc_error">%s </span>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_field_error

Use sprintf() format.

Default value'<span class="tina_mvc_error">%s </span>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_field_error  
>VPropertypublicstring $html_form_field_message = '<div class="tina_mvc_form_field_message">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_field_message

Use sprintf() format.

Default value'<div class="tina_mvc_form_field_message">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_field_message  
>VPropertypublicstring $html_form_input = '<span class="tina_mvc_form_input">%s</span>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_input

Use sprintf() format.

Default value'<span class="tina_mvc_form_input">%s</span>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_input  
>VPropertypublicstring $html_form_label = '<span class="tina_mvc_form_label">%s </span>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_label

Use sprintf() format.

Default value'<span class="tina_mvc_form_label">%s </span>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_label  
>VPropertypublicstring $html_form_message = '<div class="tina_mvc_form_message">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_message

Use sprintf() format.

Default value'<div class="tina_mvc_form_message">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_message  
>VPropertypublicstring $html_form_messages = '<div class="tina_mvc_form_messages">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_messages

Use sprintf() format.

Default value'<div class="tina_mvc_form_messages">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_messages  
>VPropertypublicstring $html_form_pair = '<div class="tina_mvc_form_pair">%s</div>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_pair

Use sprintf() format.

Default value'<div class="tina_mvc_form_pair">%s</div>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_pair  
>VPropertypublicstring $html_form_radio_set = '<span class="tina_mvc_form_radio_set">%s</span>'
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_radio_set

Use sprintf() format.

Default value'<span class="tina_mvc_form_radio_set">%s</span>'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_radio_set  
>VPropertypublicstring $html_form_required_after_input = ' (required) '
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_required_after_input

Use sprintf() format.

Default value' (required) 'Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_required_after_input  
>VPropertypublicstring $html_form_required_after_label = ''
inherited
HTML strings used for various elements generated by this helper.
Inherited from: \TINA_MVC\form_base::$$html_form_required_after_label

Use sprintf() format.

Default value''Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$html_form_required_after_label  
>VPropertyprotectedmixed $messages
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertyprotectedmixed $method
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertyprotectedstring $name = ''
inherited
The name for the form of the field.
Inherited from: \TINA_MVC\form_base::$$name

Userd to construct POST variable names and CSS id's

Default value''Details
Type
string
Inherited_from
\TINA_MVC\form_base::$$name  
>VPropertyprotectedmixed $protected_fields
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertyprotectedmixed $validation_errors
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed
>VPropertyprotectedarray $validation_rules = array()
inherited
Validation rules
Inherited from: \TINA_MVC\form_base::$$validation_rules
Default valuearray()Details
Type
array
Inherited_from
\TINA_MVC\form_base::$$validation_rules  
>VPropertyprotectedmixed $wp_nonce_field_name
Use setters and getters to access.

Tina MVC does not support direct access or class variables.

Details
Type
mixed

Methods

methodpublic__construct(String $name = '', String $action = '', Object $extra_attribs = array()) : void

Sets up the form

Parameters
NameTypeDescription
$nameString
$actionString
$extra_attribsObject
methodprivateadd_base_fields() : void

Adds the system field

It is a WP_NONCE value and is used to check if the form was posted within the validity of the WP_NONCE.

methodpublicadd_error( $m = FALSE) : void

Adds an error message or messages to the form.

Parameters
NameTypeDescription
$m

string the error message

methodpublicadd_error_count() : void

Increments the error counter

methodpublicadd_field(String $name = '', String $type = 'text', String $caption = '', String $db_table = '', String $db_field = '', String $default_val = '', String $extra_attribs = '') : object

Adds a field to the form

Parameters
NameTypeDescription
$nameString
$typeString
$captionString
$db_tableString
$db_fieldString
$default_valString
$extra_attribsString
Returns
TypeDescription
objectfield
methodpublicadd_fieldset(String $name = '', String $legend = '', Mixed $extra_attribs = '') : object

Opens a fieldset

Parameters
NameTypeDescription
$nameString
$legendString

the caption to display

$extra_attribsMixed

array of name => value pairs or a string

Returns
TypeDescription
objectfield
methodpublicadd_text(String $name = '', String $text = '', Mixed $extra_attribs = '') : object

Adds a block of text to the form

Parameters
NameTypeDescription
$nameString
$textString
$extra_attribsMixed

array of name => value pairs or a string

Returns
TypeDescription
objectfield
methodprivatecheck_validation() : boolean

Processes validation rules attached to each field

Returns
TypeDescription
booleanTRUE if the rules passed
methodpublicfieldset_close(mixed $extra_attribs = '') : object

Closes an open fieldset

Parameters
NameTypeDescription
$extra_attribsmixed

array of name => value pairs or a string

Returns
TypeDescription
objectfield
Details
Todo
Mmmm, is $extra_attribs valid for a close fieldset?  
methodpublicfieldset_open(String $name = '', String $legend = '', Mixed $extra_attribs = '') : object

Alias to add_fieldset()

Parameters
NameTypeDescription
$nameString
$legendString

the caption to display

$extra_attribsMixed

array of name => value pairs or a string

Returns
TypeDescription
objectfield
methodpublicform_posted() : boolean

Checks if the form has been posted by verifying the wp_nonce field

Returns
TypeDescription
boolean
methodpublicget_error_count() : void

Checks for errors

methodpublicget_errors() : void

Checks for errors

methodpublicget_extra_attribs() : string
inherited

Getter

Inherited from: \TINA_MVC\form_base::get_extra_attribs()
Returns
TypeDescription
string
methodpublicget_name() : String
inherited

Gets the field or form name

Inherited from: \TINA_MVC\form_base::get_name()
Returns
TypeDescription
String
methodpublicget_posted_data(string $db_table = '', boolean $get_db_fields = FALSE) : array

Gets an array of data if the form was posted.

Returns boolean FALSE otherwise

Fields can be grouped by assigning a value to the db_table field property. The data returned is an array of field_name => field_value. If you want to get an array with the keys based on the db_field property, set $get_db_fields TRUE.

Parameters
NameTypeDescription
$db_tablestring
$get_db_fieldsboolean
Returns
TypeDescription
array
Details
See
\TINA_MVC\$this->get_posted_db_value()  
methodpublicget_posted_db_data(string $db_table = '') : object

Gets an array of submitted data.

The field names are based on the db_field values in the field

Parameters
NameTypeDescription
$db_tablestring

the db_table value for the fields you want returned

Returns
TypeDescription
objectDescription
methodpublicget_xhtml_slash() : String
inherited

Returns a XML slash for self closing tags

Inherited from: \TINA_MVC\form_base::get_xhtml_slash()
Returns
TypeDescription
String
methodpublicload_data(mixed $data = FALSE) : void

Loads an array or object of data into the form

Usually a recordset from a database in the form array( array( 'field' => 'value' ) )

Parameters
NameTypeDescription
$datamixed

array or object

methodprivateload_posted_data() : void

Loads any data from $_POST

methodpublicrender() : String

Renders the forms HTML

Returns
TypeDescription
Stringthe HTML
methodprivaterender_close_form() : string

Renders the closing form tag

Returns
TypeDescription
string
methodprivaterender_open_form() : string

Renders the opening form tag and any messages

Returns
TypeDescription
string
methodpublicset_extra_attribs(mixed $attribs = FALSE) : object
inherited

Sets any extra attributes you wish to pass to the form or field

Inherited from: \TINA_MVC\form_base::set_extra_attribs()
Parameters
NameTypeDescription
$attribsmixed

An array of attribs or a string to be added directly into the element e.g. 'attrib="value"'

Returns
TypeDescription
object
methodpublicset_name(String $name = '') : object
inherited

Checks the name for the form or field element

Inherited from: \TINA_MVC\form_base::set_name()
Parameters
NameTypeDescription
$nameString

The name

Returns
TypeDescription
object

\TINA_MVC\form_base

Package: Tina-MVC\Docs
The base object for forms and fields
Children
\TINA_MVC\field
\TINA_MVC\form

Properties

>VPropertypublicbool $do_xml = TRUE
Whether or not to use XML short tags
Default valueTRUEDetails
Type
bool
>VPropertypublicstring $html_form = '<div class="tina_mvc_form">%s</div>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<div class="tina_mvc_form">%s</div>'Details
Type
string
>VPropertypublicstring $html_form_button = '<div class="tina_mvc_form_button">%s</div>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<div class="tina_mvc_form_button">%s</div>'Details
Type
string
>VPropertypublicstring $html_form_error = '<div class="tina_mvc_form_error_message">%s</div>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<div class="tina_mvc_form_error_message">%s</div>'Details
Type
string
>VPropertypublicstring $html_form_field_error = '<span class="tina_mvc_error">%s </span>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<span class="tina_mvc_error">%s </span>'Details
Type
string
>VPropertypublicstring $html_form_field_message = '<div class="tina_mvc_form_field_message">%s</div>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<div class="tina_mvc_form_field_message">%s</div>'Details
Type
string
>VPropertypublicstring $html_form_input = '<span class="tina_mvc_form_input">%s</span>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<span class="tina_mvc_form_input">%s</span>'Details
Type
string
>VPropertypublicstring $html_form_label = '<span class="tina_mvc_form_label">%s </span>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<span class="tina_mvc_form_label">%s </span>'Details
Type
string
>VPropertypublicstring $html_form_message = '<div class="tina_mvc_form_message">%s</div>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<div class="tina_mvc_form_message">%s</div>'Details
Type
string
>VPropertypublicstring $html_form_messages = '<div class="tina_mvc_form_messages">%s</div>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<div class="tina_mvc_form_messages">%s</div>'Details
Type
string
>VPropertypublicstring $html_form_pair = '<div class="tina_mvc_form_pair">%s</div>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<div class="tina_mvc_form_pair">%s</div>'Details
Type
string
>VPropertypublicstring $html_form_radio_set = '<span class="tina_mvc_form_radio_set">%s</span>'
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value'<span class="tina_mvc_form_radio_set">%s</span>'Details
Type
string
>VPropertypublicstring $html_form_required_after_input = ' (required) '
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value' (required) 'Details
Type
string
>VPropertypublicstring $html_form_required_after_label = ''
HTML strings used for various elements generated by this helper.

Use sprintf() format.

Default value''Details
Type
string
>VPropertyprotectedstring $name = ''
The name for the form of the field.

Userd to construct POST variable names and CSS id's

Default value''Details
Type
string
>VPropertyprotectedarray $validation_rules = array()
Validation rules
Default valuearray()Details
Type
array

Methods

methodpublicget_extra_attribs() : string

Getter

Returns
TypeDescription
string
methodpublicget_name() : String

Gets the field or form name

Returns
TypeDescription
String
methodpublicget_xhtml_slash() : String

Returns a XML slash for self closing tags

Returns
TypeDescription
String
methodpublicset_extra_attribs(mixed $attribs = FALSE) : object

Sets any extra attributes you wish to pass to the form or field

Parameters
NameTypeDescription
$attribsmixed

An array of attribs or a string to be added directly into the element e.g. 'attrib="value"'

Returns
TypeDescription
object
methodpublicset_name(String $name = '') : object

Checks the name for the form or field element

Parameters
NameTypeDescription
$nameString

The name

Returns
TypeDescription
object

\TINA_MVC\validate

Package: Tina-MVC\Core
All validate_* classes extend this class

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Children
\TINA_MVC\validate_required
\TINA_MVC\validate_empty
\TINA_MVC\validate_max_length
\TINA_MVC\validate_min_length
\TINA_MVC\validate_max_value
\TINA_MVC\validate_min_value
\TINA_MVC\validate_email
\TINA_MVC\validate_sql_datetime
\TINA_MVC\validate_sql_date
\TINA_MVC\validate_sql_time
\TINA_MVC\validate_equal_to_field
\TINA_MVC\validate_less_than_field
\TINA_MVC\validate_greater_than_field
\TINA_MVC\validate_regexp
\TINA_MVC\validate_recaptcha
See
\TINA_MVC\validate_required  

Properties

>VPropertypublic$validation_message = ''
The error message (if any).

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
See
class  

Methods

methodpublicvalidation_errors() : boolean

Checks for validation errors

Returns
TypeDescription
boolean

\TINA_MVC\validate_email

Package: Tina-MVC\Core
Validate as email

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, mixed $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsmixed

not used

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_empty

Package: Tina-MVC\Core
Validate as empty string

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, string $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsstring

not used

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_equal_to_field

Package: Tina-MVC\Core
Validate as equal to another field

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, object $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsobject

the other field object

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_greater_than_field

Package: Tina-MVC\Core
Validate as greater than another field

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, object $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsobject

the other field

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_less_than_field

Package: Tina-MVC\Core
Validate as less than another field

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, object $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsobject

the other field object

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_max_length

Package: Tina-MVC\Core
Validate as maximum string length

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, string $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsstring

maximum string length allowed

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_max_value

Package: Tina-MVC\Core
Validate as maximum value

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, mixed $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsmixed

max value allowed

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_min_length

Package: Tina-MVC\Core
Validate as minimum string length

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, string $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsstring

minimum length

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_min_value

Package: Tina-MVC\Core
Validate as minimum value

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, string $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsstring

min value allowed

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_recaptcha

Package: Tina-MVC\Core
Validate a field as 'recaptcha'

You should not use this validation rule directly - it is added automatically by the form class

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field_obj, mixed $params) : void

Validation code

Parameters
NameTypeDescription
$field_objobject
$paramsmixed

not used

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_regexp

Package: Tina-MVC\Core
Validate using a regular expression

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, array $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsarray

array of array( 'regexp' => 'validation message' )

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_required

Package: Tina-MVC\Core
Validate a field as 'required'

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field_obj, mixed $params) : void

Validation code

Sets $this->validation_message if validation fails

Parameters
NameTypeDescription
$field_objobject
$paramsmixed

not used

methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_sql_date

Package: Tina-MVC\Core
Validate as SQL Date (YYY-MM-DD)

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, mixed $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsmixed

not used

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_sql_datetime

Package: Tina-MVC\Core
Validate as SQL Datetime (YYY-MM-DD hh:mm:ss)

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, mixed $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsmixed

not used

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean

\TINA_MVC\validate_sql_time

Package: Tina-MVC\Core
Validate as SQL Date (hh:mm:ss)

Add your own validation classes by calling them 'validate_myrule' and declaring them in the TINA_MVC namespace. See the 'validate_required' for an example.

Parent(s)
\TINA_MVC\validate

Properties

>VPropertypublic$validation_message = ''
inherited
The error message (if any).
Inherited from: \TINA_MVC\validate::$$validation_message

Your class should set this variable if your validation function fails

Default value''Details
Type
n/a
Inherited_from
\TINA_MVC\validate::$$validation_message  
See
class  

Methods

methodpublic__construct(object $field, mixed $params) : void

Validation code

Parameters
NameTypeDescription
$fieldobject
$paramsmixed

not used

Details
See
\TINA_MVC\$this->validate_required()  
methodpublicvalidation_errors() : boolean
inherited

Checks for validation errors

Inherited from: \TINA_MVC\validate::validation_errors()
Returns
TypeDescription
boolean
Documentation was generated by phpDocumentor 2.0.0a12.