System:Template:getSelectOptions
From Aspen Documentation
Prints a list of select box options with a pre-selected value, if set. This function may easily be used with the return value of grabSelectArray.
Since 1.0
Arguments
void getSelectOptions (array $grabSelectArray, [mixed $match_value = false], [boolean $prepend_blank = false], [string $blank_text = false])
- grabSelectArray
- An array of elements to use to generate the select options.
- match
- A value to pre-select if it matches an element in the array.
- prepend_blank
- If true an empty option will be printed first.
- blank_text
- Text to fill the empty option with, if enabled.
Examples
Example:
$products_list = $this->grabSelectArray('products', 'product_name', 'DISTINCT'); print $this->getSelectOptions($products_list);