CoolCMS API

FormTrait

Requires in the host class: - $this->translator, $this->translatorDomain - $this->advertId (int), $this->showPrice (bool), isClosed(): bool - $this->responseManager (ResponseManager), $this->currencyManager (CurrencyManager) - createFormContent(), createSuccessContent(), updateModalContent() (ModalTrait)

Table of Contents

Methods

onError()  : void
Redraws the modal with the field errors. Without it an invalid AJAX submit (browser validation bypassed or off) redrew nothing and the visitor saw no message at all.
onSuccess()  : void
createComponentForm()  : Form
prepareCurrencyList()  : array<int, string>
Only public monetary currencies: "Credits" must not be offered for a response price ({@see CurrencyManager::findPublicMonetaryOptions()}).
rateLimitMessage()  : NotTranslate
"Try again later" message; with the wait in minutes when the Api sent `retryAfter` (an upper bound for the sliding Redis window, exact for the DB limiter, hence "at the latest").

Methods

onError()

Redraws the modal with the field errors. Without it an invalid AJAX submit (browser validation bypassed or off) redrew nothing and the visitor saw 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

prepareCurrencyList()

Only public monetary currencies: "Credits" must not be offered for a response price ({@see CurrencyManager::findPublicMonetaryOptions()}).

private prepareCurrencyList() : array<int, string>
Return values
array<int, string>

rateLimitMessage()

"Try again later" message; with the wait in minutes when the Api sent `retryAfter` (an upper bound for the sliding Redis window, exact for the DB limiter, hence "at the latest").

private rateLimitMessage(Result $result) : NotTranslate
Parameters
$result : Result
Return values
NotTranslate
On this page

Search results