Skip to content

Commit 538b0c9

Browse files
committed
merged branch Garfield-fr/2.2 (PR symfony#508)
This PR was merged into the 2.2 branch. Commits ------- 3550f5c Refactoring isMethod, bind and Flash Discussion ---------- Refactoring isMethod, bind and Flash and bindRequest (2.2) --------------------------------------------------------------------------- by hacfi at 2013-03-19T14:11:33Z PR looks good to me
2 parents 5fa22c5 + 3550f5c commit 538b0c9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Acme/DemoBundle/Controller/DemoController.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ public function contactAction()
3939
$form = $this->get('form.factory')->create(new ContactType());
4040

4141
$request = $this->get('request');
42-
if ('POST' == $request->getMethod()) {
43-
$form->bindRequest($request);
42+
if ($request->isMethod('POST')) {
43+
$form->bind($request);
4444
if ($form->isValid()) {
4545
$mailer = $this->get('mailer');
4646
// .. setup a message and send it
4747
// http://symfony.com/doc/current/cookbook/email.html
4848

49-
$this->get('session')->setFlash('notice', 'Message sent!');
49+
$this->get('session')->getFlashBag()->set('notice', 'Message sent!');
5050

5151
return new RedirectResponse($this->generateUrl('_demo'));
5252
}

0 commit comments

Comments
 (0)