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 97
__construct(Form $form)

Builder constructor.

Parameters

Form $form

at line 109
init()

Do initialize.

at line 120
Tools getTools()

Get form tools instance.

Return Value

Tools

at line 130
Footer getFooter()

Get form footer instance.

Return Value

Footer

at line 138
string getMode()

No description

Return Value

string

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

Set the builder mode.

Parameters

string $mode

Return Value

void

at line 162
bool isMode($mode)

Returns builder is $mode.

Parameters

$mode

Return Value

bool

at line 172
bool isCreating()

Check if is creating resource.

Return Value

bool

at line 182
bool isEditing()

Check if is editing resource.

Return Value

bool

at line 194
void setResourceId($id)

Set resource Id.

Parameters

$id

Return Value

void

at line 204
mixed getResourceId()

Get Resource id.

Return Value

mixed

at line 212
string getResource($slice = null)

No description

Parameters

$slice

Return Value

string

at line 229
array getWidth()

Get label and field width.

Return Value

array

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

No description

Parameters

int $field
int $label

Return Value

$this

at line 255
string getAction()

Get Form action.

Return Value

string

at line 277
setAction(string $action)

Set form action.

Parameters

string $action

at line 289
$this setView(string $view)

Set view for this form.

Parameters

string $view

Return Value

$this

at line 303
$this setTitle(string $title)

Set title for form.

Parameters

string $title

Return Value

$this

at line 315
Collection fields()

Get fields of this builder.

Return Value

Collection

at line 327
mixed field(string $name)

Get specify field.

Parameters

string $name

Return Value

mixed

at line 339
bool hasRows()

If the parant form has rows.

Return Value

bool

at line 349
array getRows()

Get field rows of form.

Return Value

array

at line 357
array getHiddenFields()

No description

Return Value

array

at line 367
void addHiddenField(Field $field)

No description

Parameters

Field $field

Return Value

void

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

Add or get options.

Parameters

array $options

Return Value

array|null

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

Get or set option.

Parameters

string $option
mixed $value

Return Value

$this

at line 410
string title()

No description

Return Value

string

at line 432
bool hasFile()

Determine if form fields has files.

Return Value

bool

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

Open up a new HTML form.

Parameters

array $options

Return Value

string

at line 483
string close()

Close the current form.

Return Value

string

at line 496
string renderTools()

Render form header tools.

Return Value

string

at line 506
string renderFooter()

Render form footer.

Return Value

string

at line 516
string render()

Render form.

Return Value

string

at line 537
protected void addRedirectUrlField()

Add field for store redirect url after update or store.

Return Value

void

at line 555
protected void removeReservedFields()

Remove reserved fields like id created_at updated_at in form fields.

Return Value

void