本文整理汇总了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>';