__construct()
__toString()
add()
add_csrf()
add_model()
build()
build_field()
button()
checkbox()
close()
field()
fieldset()
fieldset_close()
fieldset_open()
file()
get_attribute()
get_config()
hidden()
input()
label()
open()
password()
populate()
prep_value()
radio()
repopulate()
reset()
select()
set_attribute()
set_config()
submit()
textarea()
attr_to_string()
$_valid_inputs
$fieldset
Form Class
Helper for creating forms with support for creating dynamic form objects.
| package | Fuel |
|---|---|
| category | Core |
__construct($fieldset, array $config)
__toString() : string
stringadd($name, $label, array $attributes, array $rules) : \Fuel\Core\Fieldset_Field
add_csrf()
add_model(string | Object $class, array | Object $instance, string $method) : \Fuel\Core\Validation
stringObjecteither a full classname (including full namespace) or object instance
arrayObjectarray or object that has the exactly same named properties to populate the fields
stringmethod name to call on model for field fetching
\Fuel\Core\Validationthis, to allow chainingbuild(mixed $action) : string
mixed
stringbuild_field(string | \Fuel\Core\Fieldset_Field $field) : string
| deprecated | until v1.2 |
|---|
stringcheckbox(string | array $field, string $value, mixed $checked, array $attributes) : string
stringarrayeither fieldname or full attributes array (when array other params are ignored)
string
mixedeither attributes (array) or bool/string to set checked status
array
stringclose() : string
stringfield(string | null $name, bool $flatten) : \Fuel\Core\Fieldset_Field | false
stringnullfield name or null to fetch an array of all
boolwhether to get the fields array or flattened array
fieldset_close() : string
stringfieldset_open(array $attributes, string $legend) : string
arrayarray with tag attribute settings
stringstring for the fieldset legend
stringfile(string | array $field, array $attributes) : string
stringarrayeither fieldname or full attributes array (when array other params are ignored)
array
stringget_attribute(string $key, mixed $default) : mixed
string
mixed
mixedget_config(string | array $key, mixed $default) : mixed | array
stringarraya single key or multiple in an array, empty to fetch all
mixeddefault output when config wasn't set
mixedarraya single config value or multiple in an array when $key input was an arrayinput(string | array $field, string $value, array $attributes) : string
stringarrayeither fieldname or full attributes array (when array other params are ignored)
string
array
stringlabel(string | array $label, string $id, array $attributes) : string
stringarrayeither fieldname or full attributes array (when array other params are ignored)
string
array
stringopen(string | array $attributes, array $hidden) : string
stringarrayaction string or array with more tag attribute settings
array
stringpassword(string | array $field, string $value, array $attributes) : string
stringarrayeither fieldname or full attributes array (when array other params are ignored)
string
array
stringpopulate(array | object $input, bool $repopulate) : \Fuel\Core\Fieldset
prep_value(string $value) : string
Prepares the value for display in the form
string
stringradio(string | array $field, string $value, mixed $checked, array $attributes) : string
stringarrayeither fieldname or full attributes array (when array other params are ignored)
string
mixedeither attributes (array) or bool/string to set checked status
array
stringrepopulate() : \Fuel\Core\Fieldset_Field
reset(string | array $field, string $value, array $attributes) : string
stringarrayeither fieldname or full attributes array (when array other params are ignored)
string
array
stringselect(string | array $field, string $values, array $options, array $attributes) : string
Generates a html select element based on the given parameters
stringarrayeither fieldname or full attributes array (when array other params are ignored)
stringselected value(s)
arrayarray of options and option groups
array
stringset_attribute(string $key, mixed $value) : \Form_Instance
string
mixed
\Form_Instancesubmit(string | array $field, string $value, array $attributes) : string
stringarrayeither fieldname or full attributes array (when array other params are ignored)
string
array
stringtextarea(string | array $field, string $value, array $attributes) : string
stringarrayeither fieldname or full attributes array (when array other params are ignored)
string
array
stringattr_to_string(array $attr) : string
Wraps the global attributes function and does some form specific work
array
string$_valid_inputs