當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ContactForm::render方法代碼示例

本文整理匯總了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>';
開發者ID:robert-kirkham-fabric,項目名稱:PhpToolCase,代碼行數:31,代碼來源:ptcform-ex4.php


注:本文中的ContactForm::render方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。