Time
class Time extends Date
Traits
Constants
FILE_DELETE_FLAG |
|
FILE_SORT_FLAG |
|
Properties
array|Closure | $creationRules | The validation rules for creation. |
from Field |
array|Closure | $updateRules | The validation rules for updates. |
from Field |
bool | $isJsonType | from Field | |
protected array|string | $id | Element id. |
from Field |
protected mixed | $value | Element value. |
from Field |
protected mixed | $data | Data of all original columns of value. |
from Field |
protected mixed | $original | Field original value. |
from Field |
protected mixed | $default | Field default value. |
from Field |
protected string | $label | Element label. |
from Field |
protected string|array | $column | Column name. |
from Field |
protected string | $elementName | Form element name. |
from Field |
protected array | $elementClass | Form element classes. |
from Field |
protected array | $variables | Variables of elements. |
from Field |
protected | $options | ||
protected array | $checked | Checked for specify elements. |
from Field |
protected array|Closure | $rules | Validation rules. |
from Field |
protected Closure | $validator | from Field | |
protected array | $validationMessages | Validation messages. |
from Field |
protected | $attributes | from Date | |
protected Form | $form | Parent form. |
from Field |
protected | $view | from Date | |
protected array | $help | Help block. |
from Field |
protected mixed | $errorKey | Key for errors. |
from Field |
protected string|array | $placeholder | Placeholder for this field. |
from Field |
protected bool | $showHelp | from Field | |
protected array | $width | Width for label and field. |
from Field |
protected bool | $horizontal | If the form horizontal layout. |
from Field |
protected Closure | $customFormat | column data format. |
from Field |
protected bool | $display | from Field | |
protected array | $labelClass | from Field | |
protected array | $groupClass | from Field | |
protected Closure | $callback | from Field |
Methods
Set the validation rules for the field.
Set the update validation rules for the field.
Set the creation validation rules for the field.
Set validation messages for column.
Set help block for current field.
reset field className.
Add required
attribute to current field if has required rule,
except file and image fields.
If has required
rule, add required attribute to this field.
Details
in
Field at line 251
__construct($column = '', array $arguments = [])
Field constructor.
in
Field at line 267
$this
setElementName(string $name)
Set form element name.
in
Field at line 281
void
fill(array $data)
Fill data to the field.
in
Field at line 319
void
setOriginal(array $data)
Set original value to the field.
in
Field at line 352
$this
setWidth(int $field = 8, int $label = 2)
Set width for field and label.
in
Field at line 369
$this
options(array $options = [])
Set the field options.
in
Field at line 387
$this
checked(array $checked = [])
Set the field option checked.
in
Field at line 406
$this
rules(array $rules = [], array $messages = [])
Set the validation rules for the field.
in
Field at line 423
$this
updateRules(array|callable $rules = [], array $messages = [])
Set the update validation rules for the field.
in
Field at line 440
$this
creationRules(array|callable $rules = [], array $messages = [])
Set the creation validation rules for the field.
in
Field at line 454
array|mixed
getValidationMessages()
Get validation messages for the field.
in
Field at line 477
$this
setValidationMessages(string $key, array $messages)
Set validation messages for column.
in
Field at line 491
$this
validator(callable $validator)
Set field validator.
in
Field at line 503
string
getErrorKey()
Get key for error message.
in
Field at line 515
$this
setErrorKey(string $key)
Set key for error message.
in
Field at line 529
mixed
value(null $value = null)
Set or get value of the field.
in
Field at line 545
$this
data(array $data = null)
Set or get data.
in
Field at line 563
$this
default($default)
Set default value for field.
in
Field at line 575
mixed
getDefault()
Get default value.
in
Field at line 592
Field
help(string $text = '', bool $show_help = true, string $icon = 'bi-info-circle')
Set help block for current field.
in
Field at line 604
string
column()
Get column of the field.
in
Field at line 614
string
label()
Get label of the field.
in
Field at line 624
mixed
original()
Get original value of the field.
in
Field at line 636
bool|Validator|mixed
getValidator(array $input)
Get validator for this field.
in
Field at line 677
Field
attribute(array|string $attribute, mixed $value = null)
Add html attributes to elements.
in
Field at line 697
$this
style(string $attr, string $value)
Set Field style.
in
Field at line 709
$this
width(string $width)
Set Field width.
in
Field at line 719
$this
autofocus()
Set the field automatically get focus.
in
Field at line 729
$this
readonly()
Set the field as readonly mode.
此属性不适用于 select
in
Field at line 764
$this
placeholder(string $placeholder = '')
Set field placeholder.
in
Field at line 776
string
getPlaceholder()
Get placeholder.
in
Field at line 790
mixed
prepare($value)
Prepare for a field value before update or insert.
in
Field at line 798
$this
disableHorizontal()
No description
in
Field at line 808
array
getViewElementClasses()
No description
in
Field at line 830
array
getElementClass()
Get element class.
in
Field at line 842
$this
setElementClass(string|array $class)
Set form element class.
in
Field at line 856
$this
addElementClass($class)
Add the element class.
in
Field at line 872
$this
removeElementClass($class)
Remove element class.
in
Field at line 897
$this
resetElementClassName(string $className, string $resetClassName)
reset field className.
in
Field at line 909
string
getLabelClass()
No description
in
Field at line 931
array
variables()
Get the view variables of this field.
in
Field at line 956
string
getView()
Get view of this field.
in
Field at line 974
string
setView(string $view)
Set view of current field.
in
Field at line 981
string
getType()
No description
in
Field at line 994
$this
setDisplay(bool $display)
To set this field should render or not.
in
Date at line 24
Factory|View|string
render()
Render this filed.
in
Field at line 1035
string
__toString()
No description
in
Field at line 1045
string
getRules()
Get field validation rules.
in
Field at line 1091
array|mixed|string
formatName(string $column)
Format the name of the field.
in
Field at line 1132
protected mixed
formatColumn(string $column = '')
Format the field column name.
in
Field at line 1150
protected string|array
formatId(string|array $column)
Format the field element id.
in
Field at line 1162
protected string
formatLabel(array $arguments = [])
Format the label value.
in
Field at line 1174
protected
formatValue()
Format value by passing custom formater.
in
Field at line 1187
protected
addRequiredAttribute(array $rules)
Add required
attribute to current field if has required rule,
except file and image fields.
in
Field at line 1197
protected
addRequiredAttributeFromRules()
If has required
rule, add required attribute to this field.
in
Field at line 1218
protected array
formatRules(array|string $rules)
Format validation rules.
in
Field at line 1233
protected array|Closure
mergeRules(string|array|Closure $input, string|array $original)
No description
in
Field at line 1256
protected void
removeRule(string $rule)
Remove a specific rule by keyword.
in
Field at line 1279
protected array
sanitizeInput(array $input, string $column)
Sanitize input data.
in
Field at line 1294
protected string
formatAttributes()
Format the field attributes.
in
Field at line 1310
protected mixed
getElementClassString()
Get element class string.
in
Field at line 1333
protected string|array
getElementClassSelector()
Get element class selector.
in
Field at line 1357
protected string
getGroupClass(bool $default = false)
Get element class.
in
Field at line 1388
protected Field
addVariables(array $variables = [])
Add variables to field view.
in
Field at line 1403
protected bool
shouldRender()
If this field should render.
in
PlainInput at line 10
protected void
initPlainInput()
No description
in
PlainInput at line 17
protected PlainInput
defaultAttribute($attribute, $value)
No description