本文整理汇总了PHP中ContactForm::hasExtension方法的典型用法代码示例。如果您正苦于以下问题:PHP ContactForm::hasExtension方法的具体用法?PHP ContactForm::hasExtension怎么用?PHP ContactForm::hasExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContactForm
的用法示例。
在下文中一共展示了ContactForm::hasExtension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ContactForm
/**
* Post a contact form
*
* @return Form
*/
public function ContactForm()
{
$form = new ContactForm($this, 'ContactForm');
// we do not want to read a new URL when the form has already been submitted
// which in here, it hasn't been.
$url = isset($_SERVER['REQUEST_URI']) ? Director::protocolAndHost() . '' . $_SERVER['REQUEST_URI'] : false;
$form->loadDataFrom(array('ReturnURL' => $url));
$member = Member::currentUser();
if ($member) {
$form->loadDataFrom($member);
}
if ($form->hasExtension('FormSpamProtectionExtension')) {
$form->enableSpamProtection();
}
// hook to allow further extensions to alter the comments form
//$this->extend('alterContactForm', $form);
return $form;
}