Commit 6847e4f2 authored by Ad Schellevis's avatar Ad Schellevis

(mvc) add __empty__ item to OptionField as placeholder for an empty string

parent 4934ce12
...@@ -59,11 +59,15 @@ class OptionField extends BaseField ...@@ -59,11 +59,15 @@ class OptionField extends BaseField
// copy options to internal structure, make sure we don't copy in array structures // copy options to internal structure, make sure we don't copy in array structures
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
if (!is_array($value)) { if (!is_array($value)) {
if ($key == "__empty__") {
$this->internalOptionList[""] = $value ;
} else {
$this->internalOptionList[$key] = $value ; $this->internalOptionList[$key] = $value ;
} }
} }
} }
} }
}
/** /**
* get valid options, descriptions and selected value * get valid options, descriptions and selected value
......
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