NestedForm
class NestedForm
Class NestedForm.
Constants
DEFAULT_KEY_NAME |
|
REMOVE_FLAG_NAME |
|
REMOVE_FLAG_CLASS |
|
Properties
protected mixed | $key | ||
protected string | $relationName | ||
protected Model | $model | NestedForm key. |
|
protected Collection | $fields | Fields in form. |
|
protected array | $original | Original data for this field. |
|
protected Form | $form |
Methods
Create a new NestedForm instance.
Get current model.
Get the value of the model's primary key.
Set key for current form.
Set original values for fields.
Prepare for insert or update.
Set original data for each field.
Do prepare work before store and update.
Fetch value in input data by column name.
Get fields of this form.
Fill data to all fields in form.
Get the html and script of template.
Add nested-form fields dynamically.
No description
No description
No description
No description
Details
at line 105
__construct(string $relation, Model $model = null)
Create a new NestedForm instance.
NestedForm constructor.
at line 119
Model|null
model()
Get current model.
at line 129
mixed|null
getKey()
Get the value of the model's primary key.
at line 153
$this
setKey(mixed $key)
Set key for current form.
at line 167
$this
setForm(Form $form = null)
Set Form.
at line 179
Form
getForm()
Get form.
at line 192
$this
setOriginal(array $data, string $relatedKeyName = null)
Set original values for fields.
at line 219
mixed
prepare(array $input)
Prepare for insert or update.
at line 236
protected void
setFieldOriginalValue(string $key)
Set original data for each field.
at line 255
protected array
prepareRecord(array $record)
Do prepare work before store and update.
at line 302
protected array|mixed
fetchColumnValue(array $data, string|array $columns)
Fetch value in input data by column name.
at line 326
$this
pushField(Field $field)
No description
at line 338
Collection
fields()
Get fields of this form.
at line 350
$this
fill(array $data)
Fill data to all fields in form.
at line 365
array
getTemplateHtmlAndScript()
Get the html and script of template.
at line 387
protected Field
formatField(Field $field)
Set errorKey
elementName
elementClass
for fields inside hasmany fields.
at line 421
mixed
__call(string $method, array $arguments)
Add nested-form fields dynamically.
at line 53
Text
text(mixed $column, mixed $label)
No description
at line 53
Checkbox
checkbox(mixed $column, mixed $label)
No description
at line 53
Radio
radio(mixed $column, mixed $label)
No description
at line 53
Select
select(mixed $column, mixed $label)
No description
at line 53
MultipleSelect
multipleSelect(mixed $column, mixed $label)
No description
at line 53
Textarea
textarea(mixed $column, mixed $label)
No description
at line 53
Hidden
hidden(mixed $column, mixed $label)
No description
at line 53
Id
id(mixed $column, mixed $label)
No description
at line 53
Ip
ip(mixed $column, mixed $label)
No description
at line 53
Url
url(mixed $column, mixed $label)
No description
at line 53
Color
color(mixed $column, mixed $label)
No description
at line 53
Email
email(mixed $column, mixed $label)
No description
at line 53
Mobile
mobile(mixed $column, mixed $label)
No description
at line 53
Slider
slider(mixed $column, mixed $label)
No description
at line 53
Map
map(mixed $latitude, mixed $longitude, mixed $label)
No description
at line 53
Editor
editor(mixed $column, mixed $label)
No description
at line 53
File
file(mixed $column, mixed $label)
No description
at line 53
Image
image(mixed $column, mixed $label)
No description
at line 53
Date
date(mixed $column, mixed $label)
No description
at line 53
Datetime
datetime(mixed $column, mixed $label)
No description
at line 53
Time
time(mixed $column, mixed $label)
No description
at line 53
Year
year(mixed $column, mixed $label)
No description
at line 53
Month
month(mixed $column, mixed $label)
No description
at line 53
DateRange
dateRange(mixed $start, mixed $end, mixed $label)
No description
at line 53
DateTimeRange
datetimeRange(mixed $start, mixed $end, mixed $label)
No description
at line 53
TimeRange
timeRange(mixed $start, mixed $end, mixed $label)
No description
at line 53
Number
number(mixed $column, mixed $label)
No description
at line 53
Currency
currency(mixed $column, mixed $label)
No description
at line 53
HasMany
hasMany(mixed $relationName, mixed $callback)
No description
at line 53
SwitchField
switch() $$column, $label)
No description
at line 53
Display
display(mixed $column, mixed $label)
No description
at line 53
Rate
rate(mixed $column, mixed $label)
No description
at line 53
Divide
divider()
No description
at line 53
Password
password(mixed $column, mixed $label)
No description
at line 53
Decimal
decimal(mixed $column, mixed $label)
No description
at line 53
Html
html(mixed $html, mixed $label)
No description
at line 53
Tags
tags(mixed $column, mixed $label)
No description
at line 53
Icon
icon(mixed $column, mixed $label)
No description
at line 53
Embeds
embeds(mixed $column, mixed $label)
No description