FormItem
abstract class FormItem implements Structable
表单条目
Traits
字段属性
Properties
protected Fluent | $fieldAttr | 字段的属性 | from UseFieldAttr |
protected mixed | $default | 默认的数据 | |
array read-only | $rules | 规则 | |
protected bool | $toModel | 是否将此KEY, 加入提交模型 |
|
string read-only | $label | 标签 | |
string read-only | $name | Name |
Methods
__construct(string $name, string $label)
表单条目
string
__get($attr)
获取字段属性
false|Application|Factory|Validator
getValidator(array $input)
Get validator for this field.
struct()
返回当前表单字段的结构
mixed
getDefault()
默认数据值
bool
getToModel()
此条件是否加入到模型
object
attributes()
获取属性列表
Details
in
UseFieldAttr at line 20
protected
fieldAttrInit()
No description
in
UseFieldAttr at line 29
protected object
fieldAttr()
获取属性列表
in
UseFieldAttr at line 40
UseFieldAttr
setAttribute($attr, $value)
字段属性
in
UseFieldAttr at line 51
mixed
getAttribute($attr)
获取属性
at line 77
__construct(string $name, string $label)
表单条目
at line 92
FormItem
rules(array $value)
设置验证规则
at line 104
FormItem
default($value)
设置默认值, 当返回数据无此字段时候选择此值作为默认值
at line 110
FormItem
disabled()
No description
at line 121
string
__get($attr)
获取字段属性
at line 133
false|Application|Factory|Validator
getValidator(array $input)
Get validator for this field.
at line 155
struct()
返回当前表单字段的结构
at line 175
FormItem
help(string $help = '')
帮助文本
at line 185
mixed
getDefault()
默认数据值
at line 194
bool
getToModel()
此条件是否加入到模型
at line 203
protected object
attributes()
获取属性列表