Parameters
- attributes = array()
Functions:
-
add_options ( array selected_id = ”)
-
create_select_object_with_options (options, $selected_id = ”)
Usage:
$options = array("0" => "Apple", "1" => "Banana");
$selected_id = 1;
$select = new SelectObject(array("id" => "fruits"));
$select->add_options($options, $selected_id);
echo $select->get_template();
Output:
<select id="fruits">
<option value="0">Apple</option>
<option value="1" selected>Banana</option>
</select>