本文整理匯總了PHP中ContactForm::addOmittedField方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContactForm::addOmittedField方法的具體用法?PHP ContactForm::addOmittedField怎麽用?PHP ContactForm::addOmittedField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ContactForm
的用法示例。
在下文中一共展示了ContactForm::addOmittedField方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initialize
/**
* Initializes the honey pot. Loads CSS, and adds the field
*
* @param ContactForm
* @return HoneyPotSpamProtector
*/
public function initialize(ContactForm $proxy)
{
Requirements::customCSS("\n\t\t\t#{$this->name} {position:absolute;left:-9999em;}\n\t\t");
$proxy->addField(TextField::create($this->name, null)->setAttribute('tabindex', '-1'));
$proxy->addOmittedField($this->name);
return $this;
}
示例2: initialize
/**
* Sets up the spam question. Chooses a question at random and adds it to the form
*
* @param ContactForm
*/
public function initialize(ContactForm $proxy)
{
if (sizeof($this->questions)) {
$rand = rand(0, sizeof($this->questions) - 1);
$q = $this->questions[$rand];
$name = "SimpleQuestion_{$rand}";
$proxy->addField(LabelField::create("SimpleSpamQuestion_label_{$rand}", $this->heading))->addField(TextField::create($name, $q['question']));
$proxy->addOmittedField($name);
}
}