Spyderserve Web Development
_module->buildOptions($array, $value_field, $name_field, $add_zero, $data_fields)
Takes an array of data and produces an option array to be used in select, dropdown, searchSuggest inputs.
Name | Required | Added | Description | Type | Values | Default |
$array | Yes | The multi-dimensional array that the data is being extracted from | array | |||
$value_field | Yes | The name of the field in each line of the array to use as the value for the option | string | |||
$name_field | yes | The name of the field in each line of the array to use as the name for the option | string | |||
$add_zero | No | If set to 1 then the first line will not have a value and will have a blank name | binary | 1, 0 | 0 | |
$data_fields | No | 20180808.0 | An array of field names contained in the original multi-dimensional array that will be added as data attributes to each option | array |
This function returns an array to be used in the input option variable.