custom_fields() form()

Edit free-form attributes kept in one text field (key=value;key=value) as one input per key.

form()->custom_fields($name, $custom_fields, $extra = [], $replace = [])

Options

OptionMeaning
$custom_fieldsComma-separated keys to show.
sub_arrayName of the posted array; default custom (custom[color]).

Example

Code

$row = ['id' => 5, 'attrs' => 'color=red;size=XL'];
return form($row)->custom_fields('attrs', 'color,size,material');

Notes

  • The value is read with _attrs_string2array(); saving the posted array back is up to your code.

See also: form/container