Свойство по умолчанию
This commit is contained in:
parent
d24561c652
commit
61bc5e5709
1 changed files with 4 additions and 0 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
class Form_OptionFactory {
|
class Form_OptionFactory {
|
||||||
public $db;
|
public $db;
|
||||||
public $registry;
|
public $registry;
|
||||||
|
|
||||||
function __construct($db, $registry = null) {
|
function __construct($db, $registry = null) {
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->registry = $registry;
|
$this->registry = $registry;
|
||||||
|
|
@ -45,6 +46,9 @@ class Form_OptionFactory {
|
||||||
} else {
|
} else {
|
||||||
$field->options = $input['options'];
|
$field->options = $input['options'];
|
||||||
}
|
}
|
||||||
|
if (isset($input['default'])) {
|
||||||
|
array_unshift($field->options, ['value' => 0, 'name' => $input['default']]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function optionsDB($key, $val, $res) {
|
public function optionsDB($key, $val, $res) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue