本文整理汇总了PHP中ContactForm::create方法的典型用法代码示例。如果您正苦于以下问题:PHP ContactForm::create方法的具体用法?PHP ContactForm::create怎么用?PHP ContactForm::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContactForm
的用法示例。
在下文中一共展示了ContactForm::create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: contactAction
/**
* @Route("/contact", name="_demo_contact")
* @Template()
*/
public function contactAction()
{
$form = ContactForm::create($this->get('form.context'), 'contact');
$form->bind($this->container->get('request'), $form);
if ($form->isValid()) {
$form->send($this->get('mailer'));
$this->get('session')->setFlash('notice', 'Message sent!');
return new RedirectResponse($this->generateUrl('_demo'));
}
return array('form' => $form);
}
示例2: ContactForm
public function ContactForm()
{
// http://doc.silverstripe.org/framework/en/3.1/topics/forms
return ContactForm::create($this, "ContactForm");
}
示例3: Form
/**
* Creates a {@link ContactForm} object based on the data configured in the CMS.
* Note: does not render the form. Returns the proxy {@link ContactForm} object
*
* @return ContactForm
*/
public function Form()
{
return ContactForm::create("Form", $this->To, $this->Subject)->setSuccessMessage($this->SuccessMessage)->setIntroText($this->IntroText);
}