form::option PHP Method

option() protected static method

protected static option ( $value, $display, $selected )
    protected static function option($value, $display, $selected)
    {
        $attributes = array('value' => Html::entities($value));
        if (!is_null($selected)) {
            if (is_array($selected) and in_array($value, $selected) or $value == $selected) {
                $attributes['selected'] = 'selected';
            }
        }
        return Html::element('option', Html::entities($display), $attributes);
    }