CoolCMS API

FormTrait

Table of Contents

Constants

GDPR_PAGE_ID  : int = \App\Core\Routers\PageId::CONTENT_GDPR
Id of the GDPR page (`cms_system_pages`), the same across languages; see {@see \App\UI\Front\Base\Components\CookieBarComponent\Traits\InitTrait::resolvePolicyLink()}.
MESSAGE_MAX_LENGTH  : int = 10000
Upper limit of the message text: the column holds 64 kB, a longer text used to fail the save with a generic error.

Methods

onError()  : void
Shows the server-side validation errors next to the fields. The form is sent by AJAX and only `onSuccess` redrew the snippet, so a refused submit (browser validation off or bypassed) came back with no message at all.
onSuccess()  : void
createComponentForm()  : Form
resolveGdprLink()  : string|null
Link to the GDPR page for the consent checkbox text. Without a presenter or with a broken link it returns `null` and Latte prints the text without a link ({@see Templates/Default/Style_1.latte}).
sendEmail()  : void

Constants

GDPR_PAGE_ID

Id of the GDPR page (`cms_system_pages`), the same across languages; see {@see \App\UI\Front\Base\Components\CookieBarComponent\Traits\InitTrait::resolvePolicyLink()}.

private int GDPR_PAGE_ID = \App\Core\Routers\PageId::CONTENT_GDPR

MESSAGE_MAX_LENGTH

Upper limit of the message text: the column holds 64 kB, a longer text used to fail the save with a generic error.

private int MESSAGE_MAX_LENGTH = 10000

Methods

onError()

Shows the server-side validation errors next to the fields. The form is sent by AJAX and only `onSuccess` redrew the snippet, so a refused submit (browser validation off or bypassed) came back with no message at all.

public onError(Form $form) : void
Parameters
$form : Form

onSuccess()

public onSuccess(Form $form, ArrayHash $values) : void
Parameters
$form : Form
$values : ArrayHash

Link to the GDPR page for the consent checkbox text. Without a presenter or with a broken link it returns `null` and Latte prints the text without a link ({@see Templates/Default/Style_1.latte}).

private resolveGdprLink() : string|null
Return values
string|null

sendEmail()

private sendEmail(ArrayHash $values) : void
Parameters
$values : ArrayHash
On this page

Search results