Skip to content

Commit

Permalink
Fix yiisoft#3472: Configurable option to encode spaces in dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed May 21, 2014
1 parent ed5fe96 commit 16f279e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions framework/helpers/BaseHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,6 @@ public static function dropDownList($name, $selection = null, $items = [], $opti
}
$options['name'] = $name;
$selectOptions = static::renderSelectOptions($selection, $items, $options);
unset($options['encodeSpaces']);
return static::tag('select', "\n" . $selectOptions . "\n", $options);
}

Expand Down Expand Up @@ -808,7 +807,6 @@ public static function listBox($name, $selection = null, $items = [], $options =
$hidden = '';
}
$selectOptions = static::renderSelectOptions($selection, $items, $options);
unset($options['encodeSpaces']);
return $hidden . static::tag('select', "\n" . $selectOptions . "\n", $options);
}

Expand Down Expand Up @@ -1358,6 +1356,8 @@ public static function activeCheckbox($model, $attribute, $options = [])
*
* - groups: array, the attributes for the optgroup tags. The structure of this is similar to that of 'options',
* except that the array keys represent the optgroup labels specified in $items.
* - encodeSpaces: bool, whether to encode spaces in option prompt and option value with ` ` character.
* Defaults to `false`.
*
* The rest of the options will be rendered as the attributes of the resulting tag. The values will
* be HTML-encoded using [[encode()]]. If a value is null, the corresponding attribute will not be rendered.
Expand Down Expand Up @@ -1411,6 +1411,8 @@ public static function activeDropDownList($model, $attribute, $items, $options =
* - unselect: string, the value that will be submitted when no option is selected.
* When this attribute is set, a hidden field will be generated so that if no option is selected in multiple
* mode, we can still obtain the posted unselect value.
* - encodeSpaces: bool, whether to encode spaces in option prompt and option value with ` ` character.
* Defaults to `false`.
*
* The rest of the options will be rendered as the attributes of the resulting tag. The values will
* be HTML-encoded using [[encode()]]. If a value is null, the corresponding attribute will not be rendered.
Expand Down

0 comments on commit 16f279e

Please sign in to comment.