From 7003f1d3bbdcbda71c7d50ff306fd5c49c172a0d Mon Sep 17 00:00:00 2001 From: Albert Casademont Date: Tue, 2 Oct 2012 17:28:05 +0300 Subject: [PATCH] Use isMethod instead of a direct comparison The code is neater if we use the dedicated method available in the Request class --- book/forms.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/forms.rst b/book/forms.rst index e9da0f9ef12..e2c79ac56f8 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -214,7 +214,7 @@ controller:: ->add('dueDate', 'date') ->getForm(); - if ($request->getMethod() == 'POST') { + if ($request->isMethod('post')) { $form->bind($request); if ($form->isValid()) {