CoolCMS API

SmtpSettingFormTrait

Add/edit form of an SMTP / e-mail address setting.

The skeleton comes from BasePresenter::createForm(). The entity is flat (no translations). useSmtp switches whether the SMTP fields (host/username/password/secure) are required. The form field emailContext maps to the entity property context.

Table of Contents

Methods

createComponentEditForm()  : Form
buildSmtpSettingEntity()  : SmtpSetting
intOrNull()  : int|null
Converts mixed to int or null (empty value becomes null).
saveSmtpSettingForm()  : bool
Saves the form data. The redirect is handled by {@see \App\Core\Base\Admin\BasePresenter::createForm()}.
setSmtpSettingFormDefaults()  : void
strOrNull()  : string|null
Converts mixed to string or null (empty string becomes null).

Methods

intOrNull()

Converts mixed to int or null (empty value becomes null).

private intOrNull(mixed $value) : int|null
Parameters
$value : mixed
Return values
int|null

saveSmtpSettingForm()

Saves the form data. The redirect is handled by {@see \App\Core\Base\Admin\BasePresenter::createForm()}.

private saveSmtpSettingForm(ArrayHash<string|int, mixed> $values) : bool
Parameters
$values : ArrayHash<string|int, mixed>
Return values
bool

strOrNull()

Converts mixed to string or null (empty string becomes null).

private strOrNull(mixed $value) : string|null
Parameters
$value : mixed
Return values
string|null
On this page

Search results