Backend\Behaviors\FormController\HasOverrides
Overview
HasOverrides in the controller
Public Methods
public formAfterCancel()
public formAfterCancel(Model $model): void
formAfterCancel called after the user has cancelled the form
public formAfterCreate()
public formAfterCreate(Model $model): void
formAfterCreate is called after the creation form is saved
public formAfterDelete()
public formAfterDelete(Model $model): void
formAfterDelete called after the form model is deleted
public formAfterSave()
public formAfterSave(Model $model): void
formAfterSave is called after the creation or updating form is saved
public formAfterUpdate()
public formAfterUpdate(Model $model): void
formAfterUpdate is called after the updating form is saved
public formBeforeCreate()
public formBeforeCreate(Model $model): void
formBeforeCreate is called before the creation form is saved
public formBeforeSave()
public formBeforeSave(Model $model): void
formBeforeSave is called before the creation or updating form is saved
public formBeforeUpdate()
public formBeforeUpdate(Model $model): void
formBeforeUpdate is called before the updating form is saved
public formCreateModelObject()
public formCreateModelObject(): Model
formCreateModelObject creates a new instance of a form model. This logic can be changed by overriding it in the controller.
public formExtendFields()
public formExtendFields(
Backend\Widgets\Form $host,
October\Rain\Element\ElementHolder|array $fields
): void
formExtendFields is called after the form fields are defined
public formExtendFieldsBefore()
public formExtendFieldsBefore(Backend\Widgets\Form $host): void
formExtendFieldsBefore is called before the form fields are defined
public formExtendModel()
public formExtendModel(Model $model): Model
formExtendModel extends the supplied model used by create and update actions, the model can be altered by overriding it in the controller.
public formExtendQuery()
public formExtendQuery(October\Rain\Database\Builder $query): void
formExtendQuery extends the query used for finding the form model. Extra conditions can be applied to the query, for example, $query->withTrashed();
public formExtendRefreshData()
public formExtendRefreshData(
Backend\Widgets\Form $host,
array $saveData
): array
formExtendRefreshData is called before the form is refreshed, should return an array of additional save data.
public formExtendRefreshFields()
public formExtendRefreshFields(
Backend\Widgets\Form $host,
array $fields
): array
formExtendRefreshFields is called when the form is refreshed, giving the opportunity to modify the form fields.
public formExtendRefreshResults()
public formExtendRefreshResults(
Backend\Widgets\Form $host,
array $result
): array
formExtendRefreshResults is called after the form is refreshed, should return an array of additional result parameters.
public formGetRedirectUrl()
public formGetRedirectUrl(
string $context = null,
Model $model = null
): string
formGetRedirectUrl returns a URL based on supplied context, relative URLs are treated as backend URLs