__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
string
add($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
string
Object
either a full classname (including full namespace) or object instance
array
Object
array or object that has the exactly same named properties to populate the fields
string
method name to call on model for field fetching
\Fuel\Core\Validation
this, to allow chainingbuild(mixed $action) : string
mixed
string
build_field(string | \Fuel\Core\Fieldset_Field $field) : string
deprecated | until v1.2 |
---|
string
checkbox(string | array $field, string $value, mixed $checked, array $attributes) : string
string
array
either fieldname or full attributes array (when array other params are ignored)
string
mixed
either attributes (array) or bool/string to set checked status
array
string
close() : string
string
field(string | null $name, bool $flatten) : \Fuel\Core\Fieldset_Field | false
string
null
field name or null to fetch an array of all
bool
whether to get the fields array or flattened array
fieldset_close() : string
string
fieldset_open(array $attributes, string $legend) : string
array
array with tag attribute settings
string
string for the fieldset legend
string
file(string | array $field, array $attributes) : string
string
array
either fieldname or full attributes array (when array other params are ignored)
array
string
get_attribute(string $key, mixed $default) : mixed
string
mixed
mixed
get_config(string | array $key, mixed $default) : mixed | array
string
array
a single key or multiple in an array, empty to fetch all
mixed
default output when config wasn't set
mixed
array
a single config value or multiple in an array when $key input was an arrayinput(string | array $field, string $value, array $attributes) : string
string
array
either fieldname or full attributes array (when array other params are ignored)
string
array
string
label(string | array $label, string $id, array $attributes) : string
string
array
either fieldname or full attributes array (when array other params are ignored)
string
array
string
open(string | array $attributes, array $hidden) : string
string
array
action string or array with more tag attribute settings
array
string
password(string | array $field, string $value, array $attributes) : string
string
array
either fieldname or full attributes array (when array other params are ignored)
string
array
string
populate(array | object $input, bool $repopulate) : \Fuel\Core\Fieldset
prep_value(string $value) : string
Prepares the value for display in the form
string
string
radio(string | array $field, string $value, mixed $checked, array $attributes) : string
string
array
either fieldname or full attributes array (when array other params are ignored)
string
mixed
either attributes (array) or bool/string to set checked status
array
string
repopulate() : \Fuel\Core\Fieldset_Field
reset(string | array $field, string $value, array $attributes) : string
string
array
either fieldname or full attributes array (when array other params are ignored)
string
array
string
select(string | array $field, string $values, array $options, array $attributes) : string
Generates a html select element based on the given parameters
string
array
either fieldname or full attributes array (when array other params are ignored)
string
selected value(s)
array
array of options and option groups
array
string
set_attribute(string $key, mixed $value) : \Form_Instance
string
mixed
\Form_Instance
submit(string | array $field, string $value, array $attributes) : string
string
array
either fieldname or full attributes array (when array other params are ignored)
string
array
string
textarea(string | array $field, string $value, array $attributes) : string
string
array
either fieldname or full attributes array (when array other params are ignored)
string
array
string
attr_to_string(array $attr) : string
Wraps the global attributes function and does some form specific work
array
string
$_valid_inputs