本文整理汇总了PHP中EmailField::setCustomValidationMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailField::setCustomValidationMessage方法的具体用法?PHP EmailField::setCustomValidationMessage怎么用?PHP EmailField::setCustomValidationMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailField
的用法示例。
在下文中一共展示了EmailField::setCustomValidationMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addPersonalDetailsFields
/**
* Add fields for personal details and required fields to the validator.
*
* @param Array $fields Array of fields
* @param OrderFormValidator $validator Checkout form validator
* @param Member $member Current logged in member, or Member class singleton if no one logged in
*/
private function addPersonalDetailsFields(&$fields, &$validator, $member)
{
$emailField = new EmailField('Email', 'Email');
$emailField->setCustomValidationMessage(_t('CheckoutPage.PLEASE_ENTER_EMAIL_ADDRESS', "Please enter your email address."));
$validator->addRequiredField(_t('CheckoutPage.EMAIL', "Email"));
$personalFields = new CompositeField(new HeaderField(_t('CheckoutPage.PERSONAL_DETAILS', "Personal Details"), 3), new CompositeField($emailField, new TextField('HomePhone', _t('CheckoutPage.PHONE', "Phone"))));
if (!$member->ID || $member->Password == '') {
$link = $this->Link();
$note = _t('CheckoutPage.NOTE', 'NOTE:');
$passwd = _t('CheckoutPage.PLEASE_CHOOSE_PASSWORD', 'Please choose a password, so you can login and check your order history in the future.');
$member = sprintf(_t('CheckoutPage.ALREADY_MEMBER', 'If you are already a member please %s log in. %s'), "<a href=\"Security/login?BackURL={$link}\">", '</a>');
$lit = <<<EOS
<p class="alert alert-info">
\t<strong class="alert-heading">{$note}</strong>
\t{$passwd} <br /><br />
\t{$member}
</p>
EOS;
$personalFields->push(new CompositeField(new FieldGroup(new ConfirmedPasswordField('Password', _t('CheckoutPage.PASSWORD', "Password"))), new LiteralField('AccountInfo', $lit)));
$validator->addRequiredField('Password');
}
$personalFields->setID('PersonalDetails');
$fields['PersonalDetails'][] = $personalFields;
}