Builder
class Builder
Class Builder.
Constants
PREVIOUS_URL_KEY |
Previous url key. |
MODE_EDIT |
Modes constants. |
MODE_CREATE |
|
Properties
protected mixed | $id | ||
protected Form | $form | ||
protected | $action | ||
protected Collection | $fields | ||
protected array | $options | ||
protected string | $mode | Form action mode, could be create|view|edit. |
|
$hiddenFields | |||
protected Tools | $tools | ||
protected Footer | $footer | ||
protected array | $width | Width for label and field. |
|
protected string | $view | View for this form. |
|
protected string | $title | Form title. |
Methods
Do initialize.
No description
Set the builder mode.
Returns builder is $mode.
Check if is creating resource.
Check if is editing resource.
Set resource Id.
Get Resource id.
No description
Get label and field width.
No description
Get Form action.
Set form action.
Set view for this form.
Set title for form.
Get fields of this builder.
Get specify field.
If the parant form has rows.
Get field rows of form.
No description
Add or get options.
Get or set option.
No description
Determine if form fields has files.
Open up a new HTML form.
Close the current form.
Render form header tools.
Render form footer.
Render form.
Add field for store redirect url after update or store.
Remove reserved fields like id
created_at
updated_at
in form fields.
Details
at line 97
__construct(Form $form)
Builder constructor.
at line 109
init()
Do initialize.
at line 120
Tools
getTools()
Get form tools instance.
at line 130
Footer
getFooter()
Get form footer instance.
at line 138
string
getMode()
No description
at line 150
void
setMode(string $mode = 'create')
Set the builder mode.
at line 162
bool
isMode($mode)
Returns builder is $mode.
at line 172
bool
isCreating()
Check if is creating resource.
at line 182
bool
isEditing()
Check if is editing resource.
at line 194
void
setResourceId($id)
Set resource Id.
at line 204
mixed
getResourceId()
Get Resource id.
at line 212
string
getResource($slice = null)
No description
at line 229
array
getWidth()
Get label and field width.
at line 240
$this
setWidth(int $field = 8, int $label = 2)
No description
at line 255
string
getAction()
Get Form action.
at line 277
setAction(string $action)
Set form action.
at line 289
$this
setView(string $view)
Set view for this form.
at line 303
$this
setTitle(string $title)
Set title for form.
at line 315
Collection
fields()
Get fields of this builder.
at line 327
mixed
field(string $name)
Get specify field.
at line 339
bool
hasRows()
If the parant form has rows.
at line 349
array
getRows()
Get field rows of form.
at line 357
array
getHiddenFields()
No description
at line 367
void
addHiddenField(Field $field)
No description
at line 379
array|null
options(array $options = [])
Add or get options.
at line 396
$this
option(string $option, mixed $value = null)
Get or set option.
at line 410
string
title()
No description
at line 432
bool
hasFile()
Determine if form fields has files.
at line 450
string
open(array $options = [])
Open up a new HTML form.
at line 483
string
close()
Close the current form.
at line 496
string
renderTools()
Render form header tools.
at line 506
string
renderFooter()
Render form footer.
at line 516
string
render()
Render form.
at line 537
protected void
addRedirectUrlField()
Add field for store redirect url after update or store.
at line 555
protected void
removeReservedFields()
Remove reserved fields like id
created_at
updated_at
in form fields.