本文整理匯總了PHP中ContactForm::getFields方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContactForm::getFields方法的具體用法?PHP ContactForm::getFields怎麽用?PHP ContactForm::getFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ContactForm
的用法示例。
在下文中一共展示了ContactForm::getFields方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: mail
$headers .= 'From: marcz@lab1521.com' . "\r\n";
return mail($this->email, $this->subject, $this->message, $headers);
}
}
$emailTemplate = '<table>
<tr><th>First Name</th><td>{{nameFirst}}</td></tr>
<tr><th>Last Name</th><td>{{nameLast}}</td></tr>
<tr><th>Email</th><td>{{email}}</td></tr>
<tr><th>Phone</th><td>{{phone}}</td></tr>
<tr><th>Message</th><td></td></tr>
<tr><td colspan="2">{{message}}</td></tr>
</table>
';
$antiSpam = new AntiSpam();
$mailer = new Mailer();
$mailer->to('info@patriarch.co.nz');
$mailer->subject('Online Enquiry To VineyardForSale');
$mailer->setTemplate($emailTemplate);
if (isset($_POST['antiSpamAnswer']) && isset($_POST['antiSpamToken'])) {
$form = new ContactForm();
$form->setFields(array('nameFirst' => 'required|sanitize', 'nameLast' => 'required|sanitize', 'email' => 'required|email', 'phone' => 'required|sanitize', 'message' => 'required|sanitize', 'antiSpamAnswer' => 'required|sanitize', 'antiSpamToken' => 'required|sanitize'));
$form->setSource($_POST);
$form->setFilter(array($antiSpam, 'answer'), array('antiSpamAnswer', 'antiSpamToken'));
$validation = $form->validate();
if ($validation['success']) {
$mailer->fillTemplate($form->getFields());
$mailer->send();
}
JSON::output($validation);
}
JSON::output($antiSpam->question());