form组件隐藏域新增默认值
This commit is contained in:
parent
67363e6478
commit
2f5c62666a
@ -65,6 +65,8 @@ abstract class Form
|
||||
|
||||
protected $primaryKeyField = 'id';
|
||||
|
||||
protected $primaryKeyValue = 0;
|
||||
|
||||
protected $fieldsValue = [];
|
||||
|
||||
/**
|
||||
@ -125,7 +127,7 @@ abstract class Form
|
||||
{
|
||||
if ($this->primaryKeyField) {
|
||||
return array_merge($this->fields(), [
|
||||
self::hidden($this->primaryKeyField, 0)
|
||||
self::hidden($this->primaryKeyField, $this->primaryKeyValue)
|
||||
]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user