Method |
Description |
|
__construct ( array $array = NULL ) : Formo |
Set up new field |
|
__get ( mixed $key ) : mixed |
Return a field
Retuns NULL if the field doesn't exist |
|
__invoke ( ) : string |
Convert just the input to html |
|
__isset ( mixed $key ) : boolean |
Determine whether a field exists |
|
__set ( mixed $key, mixed $value ) : void |
Add a field to another field. Only works with Formo objects |
|
__toString ( ) : string |
Render the Formo object |
|
add ( mixed $alias, mixed $driver = NULL, mixed $value = NULL, array $opts = NULL ) : void |
Add a field or subform to a field or form |
|
add_class ( mixed $class ) : Formo |
Add a class tag to the field |
|
add_rule ( mixed $rule, array $params = NULL ) : Formo |
Add a single rule |
|
add_rule_fields ( array $rule, array $fields ) : void |
Add a single rule accross a group of fields |
|
add_rules ( array $array ) : void |
Add multiple rules at a time |
|
add_rules_fields ( array $array ) : Formo |
Add rules for multiple fields |
|
alias ( ) : string |
Helper method to return the field's alias |
|
as_array ( mixed $value = NULL, boolean $recursive = FALSE ) : array |
Return the field or form as an array |
|
attr ( mixed $get, mixed $set = NULL ) : Formo |
Set an html attribute or attributes |
|
attr_fields ( array $array ) : void |
Set attributes for a set of fields |
|
blueprint_deleted ( $field = NULL ) |
|
|
blueprint_dynamic ( $field = NULL ) |
|
|
callback ( mixed $type, array $callbacks = NULL ) : Formo |
Setup callback or callbacks |
|
close ( ) : string |
Return the field's closing tag |
|
copy_blueprint ( array $vals = [] ) : Formo |
Create a copy from form or group object |
|
driver ( mixed $func, array $args = NULL ) : mixed |
Run a method through a field's driver |
|
error ( mixed $message = NULL, array $params = [] ) : mixed |
Get or set a field error |
|
errors ( array &$array = NULL ) : array |
Get field errors |
|
factory ( array $array = NULL ) : Formo |
Simple factory method |
|
find ( mixed $alias, boolean $not_recursive = FALSE ) : mixed |
Find a field by its alias
Returns NULL if field can't be found |
|
flatten ( array &$array = NULL ) : Formo |
Flatten fields in a form |
|
form ( array $array = NULL ) : Formo |
Helper method to return a form field |
|
ftype ( array $array = [] ) |
|
|
get ( mixed $var, mixed $default = NULL ) : mixed |
Get a field attribute
You can use Arr::path dot syntax to retrieve a value |
|
html ( mixed $str = NULL ) : void |
Get or set HTML |
|
input ( ) : string |
Convert just the input to html |
|
label ( ) : void |
Return a field's label |
|
load ( array $values = NULL, array $files = NULL ) : Formo |
Load an array of alias => value pairs into a form |
|
merge ( mixed $property, array $array = NULL ) : Formo |
Merge a field with an array value with a new array |
|
merge_fields ( array $array ) : Formo |
Merge properties for multiple fields |
|
name ( ) : string |
Return a field's HTML 'name' tag value |
|
open ( ) : string |
Return a field's HTML opening tag |
|
order ( mixed $field, mixed $new_order = NULL, mixed $relative_field = NULL ) : Formo |
Reorder a field or multiple fields |
|
orm ( mixed $method, array $vals = NULL ) : Formo |
(Deprecated) Run a method through the ORM driver |
|
pad_blueprint ( $count_or_vals = 1 ) : Formo |
Pad group with number of blueprints |
|
parent ( mixed $group_or_form = FALSE ) : mixed |
Find a field's parent
If TRUE passed, find the field's parent (return that field if it is the parent) |
|
remove ( mixed $alias ) : Formo |
Remove a field or fields from a form |
|
remove_class ( mixed $class ) : Formo |
Remove a class or classes |
|
remove_rule ( mixed $rule ) : Formo |
Remove a rule or rules from a field. |
|
remove_rules ( array $array ) : void |
Remove multiple rules at a time |
|
remove_rules_fields ( mixed $array ) : void |
Remove rules for multiple fields |
|
render ( $template = NULL ) : string |
Render a field from its view file |
|
render_opts ( ) : string |
Render options (used for select, checkboxes, radios) |
|
reset ( ) : Formo |
Reset field values to their original values |
|
sent ( array $input_array = NULL ) : boolean |
Determine whether a form or field has been sent |
|
set ( mixed $var, mixed $val = NULL ) : void |
Set a value for a field's attribute
You can use Arr::set_path's dot-syntax to set an attribute |
|
set_fields ( array $array, boolean $not_recursive = TRUE ) : void |
Set variables for a set of fields |
|
set_var_fields ( mixed $var, array $array, boolean $not_recursive = TRUE ) : void |
Set a single variable for a set of fields |
|
subform ( mixed $alias, array $fields, array $order = NULL, string $driver = 'group' ) : Formo |
Create a subform from an array list of fields already in a form |
|
title ( ) : string |
Return a field's title |
|
to_array ( array $attributes = NULL ) : array |
Use for casting to json or for sending form objects across an api |
|
val ( $new_val = NULL, $force_new = FALSE ) |
|
|
validate ( ) : boolean |
Validate all fields and return whether form passed validation |
|
validation ( array $array = NULL ) : Validation |
Fetch a validation object from a field or form |
|
validation_errors ( Kohana_Validation $validation ) : mixed |
Format error messages from a validation object according to Formo's
formatting rules |
|