0

Normally I am using formbuilder to get the post data from form.

However,now I need very simple form not relevant with entity.

I can get the method like this and

if ($this->getRequest()->isMethod('POST')) {/

I want to get the each form data.(name is form name)

echo($this->getRequest()->get('name')->getData());

it shows error.

I used to use formbuilder and bindRequet normally to pick the data from form object.

How can I get the each form data from this->getRequest() without using formbuilder?

xdazz
  • 158,678
  • 38
  • 247
  • 274
whitebear
  • 11,200
  • 24
  • 114
  • 237
  • whitebear please investigate a bit yourself before asking these kind of questions :) There is a highly upvoted answer with 60k+ views ... for me it's the second! result returned by a simple "symfony post request" google search. I'm pretty sure you could've found that one faster than asking this question. – Nicolai Fröhlich Feb 24 '14 at 06:06
  • Sorry,I dodn't understand which way I should investigate,I will be carefully check the post log. – whitebear Feb 24 '14 at 06:22

1 Answers1

2

You could get it from the request property:

$this->getRequest()->request->get('foo');
xdazz
  • 158,678
  • 38
  • 247
  • 274