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

This commit is contained in:
Ad Schellevis 2015-05-28 15:04:06 +02:00
parent 4934ce1221
commit 6847e4f2ee

View File

@ -59,7 +59,11 @@ class OptionField extends BaseField
// copy options to internal structure, make sure we don't copy in array structures
foreach ($data as $key => $value) {
if (!is_array($value)) {
$this->internalOptionList[$key] = $value ;
if ($key == "__empty__") {
$this->internalOptionList[""] = $value ;
} else {
$this->internalOptionList[$key] = $value ;
}
}
}
}