Skip to content

Commit 2fcff4e

Browse files
committed
Merge branch '1.3/develop' of github.com:fuel/core into 1.3/develop
2 parents 3ddaf31 + 93f886c commit 2fcff4e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

classes/fieldset/field.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,10 @@ public function get_attribute($key = null, $default = null)
336336
*
337337
* @param string|array one option value, or multiple value=>label pairs in an array
338338
* @param string
339+
* @param bool Whether or not to replace the current options
339340
* @return Fieldset_Field this, to allow chaining
340341
*/
341-
public function set_options($value, $label = null)
342+
public function set_options($value, $label = null, $replace_options = false)
342343
{
343344
if ( ! is_array($value))
344345
{
@@ -361,7 +362,7 @@ public function set_options($value, $label = null)
361362
}
362363
};
363364

364-
empty($this->options) ? $this->options = $value : $merge($this->options, $value, $merge);
365+
($replace_options or empty($this->options)) ? $this->options = $value : $merge($this->options, $value, $merge);
365366

366367
return $this;
367368
}

0 commit comments

Comments
 (0)