Documentation

FormPageTrait

Form Page Trait

Table of Contents

Methods

formSubmitted()  : mixed
handles form submission
formValidate()  : bool|string
validates form submission
getForm()  : Form|null
get form object
getFormDefinition()  : Form
gets form definition object
addSubmitButton()  : Form
adds submit button to form
beforeRender()  : Response|self
{@intheritdocs}
fillConfirmationForm()  : Form
gets a form for confirmation
getFormId()  : string
gets form id
isSubmitted()  : bool
check if form is submitted

Methods

formSubmitted()

handles form submission

public abstract formSubmitted(Form $form, array<string|int, mixed> &$form_state) : mixed
Parameters
$form : Form
$form_state : array<string|int, mixed>

formValidate()

validates form submission

public abstract formValidate(Form $form, array<string|int, mixed> &$form_state) : bool|string
Parameters
$form : Form
$form_state : array<string|int, mixed>
Return values
bool|string

getForm()

get form object

public getForm() : Form|null
Return values
Form|null

getFormDefinition()

gets form definition object

public abstract getFormDefinition(Form $form, array<string|int, mixed> &$form_state) : Form
Parameters
$form : Form
$form_state : array<string|int, mixed>
Return values
Form

addSubmitButton()

adds submit button to form

protected addSubmitButton(Form $form[, bool $inline_button = false ][, bool $isConfirmation = false ]) : Form
Parameters
$form : Form
$inline_button : bool = false
$isConfirmation : bool = false
Tags
throws
FormException
Return values
Form

fillConfirmationForm()

gets a form for confirmation

protected fillConfirmationForm(string $confirm_message, Form $form[, string|null $cancel_url = null ]) : Form
Parameters
$confirm_message : string
$form : Form
$cancel_url : string|null = null
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
Return values
Form

getFormId()

gets form id

protected getFormId() : string
Return values
string

isSubmitted()

check if form is submitted

protected isSubmitted() : bool
Return values
bool

        
On this page

Search results