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.

protected array $hiddenFields
protected Tools $tools
$footer
protected array $width

Width for label and field.

protected string $view

View for this form.

protected string $title

Form title.

Methods

__construct(Form $form)

Builder constructor.

init()

Do initialize.

getTools()

Get form tools instance.

getFooter()

Get form footer instance.

string
getMode()

No description

void
setMode(string $mode = 'create')

Set the builder mode.

bool
isMode($mode)

Returns builder is $mode.

bool
isCreating()

Check if is creating resource.

bool
isEditing()

Check if is editing resource.

void
setResourceId($id)

Set resource Id.

mixed
getResourceId()

Get Resource id.

string
getResource($slice = null)

No description

array
getWidth()

Get label and field width.

$this
setWidth(int $field = 8, int $label = 2)

No description

string
getAction()

Get Form action.

setAction(string $action)

Set form action.

$this
setView(string $view)

Set view for this form.

$this
setTitle(string $title)

Set title for form.

Collection
fields()

Get fields of this builder.

mixed
field(string $name)

Get specify field.

bool
hasRows()

If the parant form has rows.

array
getRows()

Get field rows of form.

array
getHiddenFields()

No description

void
addHiddenField(Field $field)

No description

array|null
options(array $options = [])

Add or get options.

$this
option(string $option, mixed $value = null)

Get or set option.

string
title()

No description

bool
hasFile()

Determine if form fields has files.

string
open(array $options = [])

Open up a new HTML form.

string
close()

Close the current form.

string
renderTools()

Render form header tools.

string
renderFooter()

Render form footer.

string
render()

Render form.

void
addRedirectUrlField()

Add field for store redirect url after update or store.

void
removeReservedFields()

Remove reserved fields like id created_at updated_at in form fields.

Details

at line 103
__construct(Form $form)

Builder constructor.

Parameters

Form $form

at line 115
init()

Do initialize.

at line 126
Tools getTools()

Get form tools instance.

Return Value

Tools

at line 136
Footer getFooter()

Get form footer instance.

Return Value

Footer

at line 144
string getMode()

No description

Return Value

string

at line 156
void setMode(string $mode = 'create')

Set the builder mode.

Parameters

string $mode

Return Value

void

at line 168
bool isMode($mode)

Returns builder is $mode.

Parameters

$mode

Return Value

bool

at line 178
bool isCreating()

Check if is creating resource.

Return Value

bool

at line 188
bool isEditing()

Check if is editing resource.

Return Value

bool

at line 200
void setResourceId($id)

Set resource Id.

Parameters

$id

Return Value

void

at line 210
mixed getResourceId()

Get Resource id.

Return Value

mixed

at line 218
string getResource($slice = null)

No description

Parameters

$slice

Return Value

string

at line 235
array getWidth()

Get label and field width.

Return Value

array

at line 246
$this setWidth(int $field = 8, int $label = 2)

No description

Parameters

int $field
int $label

Return Value

$this

at line 261
string getAction()

Get Form action.

Return Value

string

at line 283
setAction(string $action)

Set form action.

Parameters

string $action

at line 295
$this setView(string $view)

Set view for this form.

Parameters

string $view

Return Value

$this

at line 309
$this setTitle(string $title)

Set title for form.

Parameters

string $title

Return Value

$this

at line 321
Collection fields()

Get fields of this builder.

Return Value

Collection

at line 333
mixed field(string $name)

Get specify field.

Parameters

string $name

Return Value

mixed

at line 345
bool hasRows()

If the parant form has rows.

Return Value

bool

at line 355
array getRows()

Get field rows of form.

Return Value

array

at line 363
array getHiddenFields()

No description

Return Value

array

at line 373
void addHiddenField(Field $field)

No description

Parameters

Field $field

Return Value

void

at line 385
array|null options(array $options = [])

Add or get options.

Parameters

array $options

Return Value

array|null

at line 402
$this option(string $option, mixed $value = null)

Get or set option.

Parameters

string $option
mixed $value

Return Value

$this

at line 416
string title()

No description

Return Value

string

at line 438
bool hasFile()

Determine if form fields has files.

Return Value

bool

at line 456
string open(array $options = [])

Open up a new HTML form.

Parameters

array $options

Return Value

string

at line 489
string close()

Close the current form.

Return Value

string

at line 502
string renderTools()

Render form header tools.

Return Value

string

at line 512
string renderFooter()

Render form footer.

Return Value

string

at line 522
string render()

Render form.

Return Value

string

at line 543
protected void addRedirectUrlField()

Add field for store redirect url after update or store.

Return Value

void

at line 561
protected void removeReservedFields()

Remove reserved fields like id created_at updated_at in form fields.

Return Value

void