This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

option_state function

Defined in /init/custom_helpers.php, lines 149-152
Author LemonStand eCommerce Inc.
string function option_state(mixed $current_value, mixed $selected_value)
$current_value mixed specifies a value of current OPTION element.
$selected_value mixed specifies a selected value.
{return} string returns selected="selected" string or empty string.
Returns selected="selected" string if the parameter values are equal. Use this function for programming OPTION elements inside SELECT tag. The following code creates a select element for selecting a country state.
<select>
  <? foreach ($states as $state): ?>
    <option <?= option_state($current_state, $state->id) ?> value="<?= h($state->id) ?>"><?= h($state->name) ?></option>
  <? endforeach ?>
</select>