trait FormExtendable

Methods

formValidate($model, $form)

Called to validate create or edit form.

formBeforeSave($model)

Called before the creation or updating form is saved.

formAfterSave($model)

Called after the creation or updating form is saved.

formBeforeCreate($model)

Called before the creation form is saved.

formAfterCreate($model)

Called after the creation form is saved.

formBeforeUpdate($model)

Called before the updating form is saved.

formAfterUpdate($model)

Called after the updating form is saved.

formAfterDelete($model)

Called after the form model is deleted.

formFindModelObject(string $recordId)

Finds a Model record by its primary identifier, used by edit actions. This logic can be changed by overriding it in the controller.

formCreateModelObject()

Creates a new instance of a form model. This logic can be changed by overriding it in the controller.

void
formExtendFieldsBefore(Form $host)

Called before the form fields are defined.

void
formExtendFields(Form $host, $fields)

Called after the form fields are defined.

array
formExtendRefreshData(Form $host, array $saveData)

Called before the form is refreshed, should return an array of additional save data.

array
formExtendRefreshFields(Form $host, array $fields)

Called when the form is refreshed, giving the opportunity to modify the form fields.

array
formExtendRefreshResults(Form $host, array $result)

Called after the form is refreshed, should return an array of additional result parameters.

formExtendModel(Model $model)

Extend supplied model used by create and edit actions, the model can be altered by overriding it in the controller.

void
formExtendQuery(Builder $query)

Extend the query used for finding the form model. Extra conditions can be applied to the query, for example, $query->withTrashed();

formExtendConfig($formConfig)

No description

static void
extendFormFields(callable $callback)

Static helper for extending form fields.

Details

at line 13
formValidate($model, $form)

Called to validate create or edit form.

Parameters

$model
$form

at line 20
formBeforeSave($model)

Called before the creation or updating form is saved.

Parameters

$model

at line 27
formAfterSave($model)

Called after the creation or updating form is saved.

Parameters

$model

at line 34
formBeforeCreate($model)

Called before the creation form is saved.

Parameters

$model

at line 41
formAfterCreate($model)

Called after the creation form is saved.

Parameters

$model

at line 48
formBeforeUpdate($model)

Called before the updating form is saved.

Parameters

$model

at line 55
formAfterUpdate($model)

Called after the updating form is saved.

Parameters

$model

at line 62
formAfterDelete($model)

Called after the form model is deleted.

Parameters

$model

at line 75
formFindModelObject(string $recordId)

Finds a Model record by its primary identifier, used by edit actions. This logic can be changed by overriding it in the controller.

Parameters

string $recordId

Exceptions

Exception

at line 108
formCreateModelObject()

Creates a new instance of a form model. This logic can be changed by overriding it in the controller.

at line 120
void formExtendFieldsBefore(Form $host)

Called before the form fields are defined.

Parameters

Form $host

The hosting form widget

Return Value

void

at line 131
void formExtendFields(Form $host, $fields)

Called after the form fields are defined.

Parameters

Form $host

The hosting form widget

$fields

Return Value

void

at line 143
array formExtendRefreshData(Form $host, array $saveData)

Called before the form is refreshed, should return an array of additional save data.

Parameters

Form $host

The hosting form widget

array $saveData

Current save data

Return Value

array

at line 155
array formExtendRefreshFields(Form $host, array $fields)

Called when the form is refreshed, giving the opportunity to modify the form fields.

Parameters

Form $host

The hosting form widget

array $fields

Current form fields

Return Value

array

at line 167
array formExtendRefreshResults(Form $host, array $result)

Called after the form is refreshed, should return an array of additional result parameters.

Parameters

Form $host

The hosting form widget

array $result

Current result parameters.

Return Value

array

at line 179
formExtendModel(Model $model)

Extend supplied model used by create and edit actions, the model can be altered by overriding it in the controller.

Parameters

Model $model

at line 191
void formExtendQuery(Builder $query)

Extend the query used for finding the form model. Extra conditions can be applied to the query, for example, $query->withTrashed();

Parameters

Builder $query

Return Value

void

at line 195
formExtendConfig($formConfig)

No description

Parameters

$formConfig

at line 206
static void extendFormFields(callable $callback)

Static helper for extending form fields.

Parameters

callable $callback

Return Value

void