Commit 16f279eb by Kartik Visweswaran

Fix #3472: Configurable option to encode spaces in dropdowns

parent ed5fe964
...@@ -745,7 +745,6 @@ class BaseHtml ...@@ -745,7 +745,6 @@ class BaseHtml
} }
$options['name'] = $name; $options['name'] = $name;
$selectOptions = static::renderSelectOptions($selection, $items, $options); $selectOptions = static::renderSelectOptions($selection, $items, $options);
unset($options['encodeSpaces']);
return static::tag('select', "\n" . $selectOptions . "\n", $options); return static::tag('select', "\n" . $selectOptions . "\n", $options);
} }
...@@ -808,7 +807,6 @@ class BaseHtml ...@@ -808,7 +807,6 @@ class BaseHtml
$hidden = ''; $hidden = '';
} }
$selectOptions = static::renderSelectOptions($selection, $items, $options); $selectOptions = static::renderSelectOptions($selection, $items, $options);
unset($options['encodeSpaces']);
return $hidden . static::tag('select', "\n" . $selectOptions . "\n", $options); return $hidden . static::tag('select', "\n" . $selectOptions . "\n", $options);
} }
...@@ -1358,6 +1356,8 @@ class BaseHtml ...@@ -1358,6 +1356,8 @@ class BaseHtml
* *
* - groups: array, the attributes for the optgroup tags. The structure of this is similar to that of '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. * 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 * 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. * be HTML-encoded using [[encode()]]. If a value is null, the corresponding attribute will not be rendered.
...@@ -1411,6 +1411,8 @@ class BaseHtml ...@@ -1411,6 +1411,8 @@ class BaseHtml
* - unselect: string, the value that will be submitted when no option is selected. * - 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 * 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. * 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 * 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. * be HTML-encoded using [[encode()]]. If a value is null, the corresponding attribute will not be rendered.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment