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|stringgetForm()
get form object
public
getForm() : Form|null
Return values
Form|nullgetFormDefinition()
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
FormaddSubmitButton()
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
Return values
FormbeforeRender()
{@intheritdocs}
protected
beforeRender() : Response|self
Tags
Return values
Response|selffillConfirmationForm()
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
Return values
FormgetFormId()
gets form id
protected
getFormId() : string
Return values
stringisSubmitted()
check if form is submitted
protected
isSubmitted() : bool