PHP Class Formo_Core_Innards

ファイルを表示 Open project: bmidget/kohana-formo

Protected Properties

Property Type Description
$_alias mixed The field alias
$_attr mixed Array of HTML attributes
$_blueprint boolean (default value: false)
$_blueprint_count integer (default value: 0)
$_blueprint_dynamic boolean (default value: false)
$_blueprint_pks aray (default value=: array())
$_blueprint_template mixed Allow for setting custom blueprint template separate from blueprint
$_callbacks array (default value: array())
$_config array (default value: array())
$_construct_aliases array Used at construct for reconciling variables
$_driver mixed Field's driver name
$_editable boolean (default value: true)
$_errors array (default value: array())
$_fields array (default value: array())
$_filters array (default value: array())
$_ftype string Used for auto-loading config defaults
$_html mixed HTML instide a tag
$_label mixed (default value: self::NOTSET)
$_opts array (default value: array())
$_parent mixed Field's parent object
$_render boolean (default value: true)
$_rules array (default value: array())
$_single_tags array HTML tags that don't have a closing
$_to_array_attrs mixed List of attributes that get copied by default in Formo::to_array()
$_vals mixed Keep track of field's values
$_vars array (default value: array())

Public Methods

Method Description
config ( mixed $param, mixed $default = NULL ) : void Find a config value.
range ( mixed $field, mixed $form ) : boolean Validation method that properly validates for html5 range

Protected Methods

Method Description
_add_rule ( array $rule ) : void Add a rule to a field.
_add_rules_to_validation ( Validation $validation ) : void Add rules to a validation object.
_arr_dotsyntax ( array $array ) : array Convert a multidmensional array to dot-syntax key values
_attr_to_str ( ) : void Turn attributes array into a string.
_error_to_msg ( array $errors_array = NULL ) : string Convert an error returned from the Validation object to a formatted message
_get_files_array ( array $files ) : array Convert $_FILES array to one Formo understands
_get_label ( $label = NULL ) : string Return the formatted string for a field.
_get_val ( ) : void Return a field's value.
_get_var_name ( mixed $var ) : string For set() and get(), return the variable name being set, and gotten
_is_blueprint_def ( Formo $parent = NULL, $test = false ) : void Determine whether a field is paret of a blueprint definition
_load ( array $array ) : void Load values into the form
_make_id ( ) : void Make an id for a field that doesn't already have one
_merge ( mixed $name, array $array ) : void Merge an array of values with another array of values
_order ( mixed $field_alias, mixed $new_order, mixed $relative_field = NULL ) : void Internal method to reorder fields
_remove_rule ( mixed $rule ) : void Search for and remove a rule if it exists
_reset ( ) : Formo Reset field values to their original values
_resolve_construct_aliases ( mixed $array ) : void Allow non-associative arrays to define a new field
_resolve_namespaced_files ( array $files ) : array Convert namespaced $_FILES array into values Formo can understand
_run_callbacks ( mixed $type = NULL ) : void Internal method to run all applicable callbacks
_set_driver ( mixed $driver ) : void Set a field's driver
_set_id ( array &$array ) : void Set a field's id attribute if the auto_id config setting is TRUE
_set_val ( mixed $val, mixed $force_new = FALSE ) : void Set the field's value
_setup_from_ftype ( ) : void Default field definitions from config file

Method Details

_add_rule() protected method

Add a rule to a field.
protected _add_rule ( array $rule ) : void
$rule array
return void

_add_rules_to_validation() protected method

Add rules to a validation object.
protected _add_rules_to_validation ( Validation $validation ) : void
$validation Validation
return void

_arr_dotsyntax() protected method

Convert a multidmensional array to dot-syntax key values
protected _arr_dotsyntax ( array $array ) : array
$array array
return array

_attr_to_str() protected method

Turn attributes array into a string.
protected _attr_to_str ( ) : void
return void

_error_to_msg() protected method

Convert an error returned from the Validation object to a formatted message
protected _error_to_msg ( array $errors_array = NULL ) : string
$errors_array array (default: NULL)
return string

_get_files_array() protected method

Convert $_FILES array to one Formo understands
protected _get_files_array ( array $files ) : array
$files array
return array

_get_label() protected method

Return the formatted string for a field.
protected _get_label ( $label = NULL ) : string
return string

_get_val() protected method

Return a field's value.
protected _get_val ( ) : void
return void

_get_var_name() protected method

For set() and get(), return the variable name being set, and gotten
protected _get_var_name ( mixed $var ) : string
$var mixed
return string

_is_blueprint_def() protected method

Determine whether a field is paret of a blueprint definition
protected _is_blueprint_def ( Formo $parent = NULL, $test = false ) : void
$parent Formo (default: FALSE)
return void

_load() protected method

Load values into the form
protected _load ( array $array ) : void
$array array
return void

_make_id() protected method

Make an id for a field that doesn't already have one
protected _make_id ( ) : void
return void

_merge() protected method

Merge an array of values with another array of values
protected _merge ( mixed $name, array $array ) : void
$name mixed
$array array
return void

_order() protected method

Internal method to reorder fields
protected _order ( mixed $field_alias, mixed $new_order, mixed $relative_field = NULL ) : void
$field_alias mixed
$new_order mixed
$relative_field mixed (default: NULL)
return void

_remove_rule() protected method

Search for and remove a rule if it exists
protected _remove_rule ( mixed $rule ) : void
$rule mixed
return void

_reset() protected method

Reset field values to their original values
protected _reset ( ) : Formo
return Formo obj

_resolve_construct_aliases() protected method

Allow non-associative arrays to define a new field
protected _resolve_construct_aliases ( mixed $array ) : void
$array mixed
return void

_resolve_namespaced_files() protected method

Convert namespaced $_FILES array into values Formo can understand
protected _resolve_namespaced_files ( array $files ) : array
$files array
return array

_run_callbacks() protected method

Internal method to run all applicable callbacks
protected _run_callbacks ( mixed $type = NULL ) : void
$type mixed (default: NULL)
return void

_set_driver() protected method

Set a field's driver
protected _set_driver ( mixed $driver ) : void
$driver mixed
return void

_set_id() protected method

Set a field's id attribute if the auto_id config setting is TRUE
protected _set_id ( array &$array ) : void
$array array
return void

_set_val() protected method

Set the field's value
protected _set_val ( mixed $val, mixed $force_new = FALSE ) : void
$val mixed
$force_new mixed (default: FALSE)
return void

_setup_from_ftype() protected method

Default field definitions from config file
protected _setup_from_ftype ( ) : void
return void

config() public method

Find a config value.
public config ( mixed $param, mixed $default = NULL ) : void
$param mixed
$default mixed (default: NULL)
return void

range() public static method

Validation method that properly validates for html5 range
public static range ( mixed $field, mixed $form ) : boolean
$field mixed
$form mixed
return boolean

Property Details

$_alias protected_oe property

The field alias
protected mixed $_alias
return mixed

$_attr protected_oe property

Array of HTML attributes
protected mixed $_attr
return mixed

$_blueprint protected_oe property

(default value: false)
protected bool $_blueprint
return boolean

$_blueprint_count protected_oe property

(default value: 0)
protected int $_blueprint_count
return integer

$_blueprint_dynamic protected_oe property

(default value: false)
protected bool $_blueprint_dynamic
return boolean

$_blueprint_pks protected_oe property

(default value=: array())
protected aray $_blueprint_pks
return aray

$_blueprint_template protected_oe property

Allow for setting custom blueprint template separate from blueprint
protected mixed $_blueprint_template
return mixed

$_callbacks protected_oe property

(default value: array())
protected array $_callbacks
return array

$_config protected_oe property

(default value: array())
protected array $_config
return array

$_construct_aliases protected_oe static_oe property

Used at construct for reconciling variables
protected static array $_construct_aliases
return array

$_driver protected_oe property

Field's driver name
protected mixed $_driver
return mixed

$_editable protected_oe property

(default value: true)
protected bool $_editable
return boolean

$_errors protected_oe property

(default value: array())
protected array $_errors
return array

$_fields protected_oe property

(default value: array())
protected array $_fields
return array

$_filters protected_oe property

(default value: array())
protected array $_filters
return array

$_ftype protected_oe property

Used for auto-loading config defaults
protected string $_ftype
return string

$_html protected_oe property

HTML instide a tag
protected mixed $_html
return mixed

$_label protected_oe property

(default value: self::NOTSET)
protected mixed $_label
return mixed

$_opts protected_oe property

(default value: array())
protected array $_opts
return array

$_parent protected_oe property

Field's parent object
protected mixed $_parent
return mixed

$_render protected_oe property

(default value: true)
protected bool $_render
return boolean

$_rules protected_oe property

(default value: array())
protected array $_rules
return array

$_single_tags protected_oe static_oe property

HTML tags that don't have a closing
protected static array $_single_tags
return array

$_to_array_attrs protected_oe static_oe property

List of attributes that get copied by default in Formo::to_array()
protected static mixed $_to_array_attrs
return mixed

$_vals protected_oe property

Keep track of field's values
protected mixed $_vals
return mixed

$_vars protected_oe property

(default value: array())
protected array $_vars
return array