@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,
);
}