Свойство по умолчанию

This commit is contained in:
Podlesnov Phedor 2021-06-28 15:10:15 +03:00
parent d24561c652
commit 61bc5e5709

View file

@ -3,6 +3,7 @@
class Form_OptionFactory {
public $db;
public $registry;
function __construct($db, $registry = null) {
$this->db = $db;
$this->registry = $registry;
@ -45,6 +46,9 @@ class Form_OptionFactory {
} else {
$field->options = $input['options'];
}
if (isset($input['default'])) {
array_unshift($field->options, ['value' => 0, 'name' => $input['default']]);
}
}
public function optionsDB($key, $val, $res) {