本文整理匯總了PHP中ContactForm::render方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContactForm::render方法的具體用法?PHP ContactForm::render怎麽用?PHP ContactForm::render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ContactForm
的用法示例。
在下文中一共展示了ContactForm::render方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: rendering
global $email_address, $mail_subject;
$mail_body = "Firstname: " . $_POST['ct_firstname'] . "\n";
$mail_body .= "Lastname: " . $_POST['ct_lastname'] . "\n";
$mail_body .= "Email: " . $_POST['ct_email'] . "\n";
$mail_body .= "Phone: " . $_POST['ct_phone'] . "\n";
$mail_body .= "Reason: " . $_POST['ct_reason'] . "\n";
$mail_body .= "Message: " . $_POST['ct_message'] . "\n";
mail($email_address, $mail_subject, $mail_body);
$msg = '<div class="errMsg" style="text-align:center;width:' . $obj->getOption('form_width') . '">Form has been sent!</div><br>';
}
public static function rendering($container, $obj)
{
// do something before the html is printed
$title = '<div style="text-align:center;width:' . $obj->getOption('form_width') . '"><h1>Contact Form</h1></div>';
$container = $title . $container;
}
}
$form = new ContactForm();
echo '<!DOCTYPE html><html><head>';
/* (OPTIONAL) INCLUDE JS FOR JQUERY VALIDATOR AND UI STYLES PLUGINS */
//require_once("ptcforms-ui-plugins.php");
/* MINIMAL CSS FOR THE EXAMPLE */
echo '<style>
body{font:normal .85em "trebuchet ms",arial,sans-serif;color:#555;}
input[type=text], select, textarea{width:220px;}
.errMsg{color:red;}
</style>';
echo '</head><body>';
/* FINALLY RENDER THE FORM */
$form->render();
echo '</body></html>';