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 103
__construct(Form $form)
Builder constructor.
at line 115
init()
Do initialize.
at line 126
Tools
getTools()
Get form tools instance.
at line 136
Footer
getFooter()
Get form footer instance.
at line 144
string
getMode()
No description
at line 156
void
setMode(string $mode = 'create')
Set the builder mode.
at line 168
bool
isMode($mode)
Returns builder is $mode.
at line 178
bool
isCreating()
Check if is creating resource.
at line 188
bool
isEditing()
Check if is editing resource.
at line 200
void
setResourceId($id)
Set resource Id.
at line 210
mixed
getResourceId()
Get Resource id.
at line 218
string
getResource($slice = null)
No description
at line 235
array
getWidth()
Get label and field width.
at line 246
$this
setWidth(int $field = 8, int $label = 2)
No description
at line 261
string
getAction()
Get Form action.
at line 283
setAction(string $action)
Set form action.
at line 295
$this
setView(string $view)
Set view for this form.
at line 309
$this
setTitle(string $title)
Set title for form.
at line 321
Collection
fields()
Get fields of this builder.
at line 333
mixed
field(string $name)
Get specify field.
at line 345
bool
hasRows()
If the parant form has rows.
at line 355
array
getRows()
Get field rows of form.
at line 363
array
getHiddenFields()
No description
at line 373
void
addHiddenField(Field $field)
No description
at line 385
array|null
options(array $options = [])
Add or get options.
at line 402
$this
option(string $option, mixed $value = null)
Get or set option.
at line 416
string
title()
No description
at line 438
bool
hasFile()
Determine if form fields has files.
at line 456
string
open(array $options = [])
Open up a new HTML form.
at line 489
string
close()
Close the current form.
at line 502
string
renderTools()
Render form header tools.
at line 512
string
renderFooter()
Render form footer.
at line 522
string
render()
Render form.
at line 543
protected void
addRedirectUrlField()
Add field for store redirect url after update or store.
at line 561
protected void
removeReservedFields()
Remove reserved fields like id
created_at
updated_at
in form fields.