Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form request obj tip #758

Merged
merged 2 commits into from
Oct 15, 2011
Merged

Conversation

mdpatrick
Copy link
Contributor

No description provided.

@weaverryan
Copy link
Member

I think we should modify this or maybe not include i - here's why:

  • In reality, since forms elements are always namespaced, you'd actually need to use the form's "name" to get at the entire submitted array (not directly at a single field)

    $allTheData = $request->request->get('some_prefix_product');
    
  • I think we should say quite directly that this is how you access the raw POST data

  • We should warn against using this - the data is on $form->getData(). I see a lot of new people call $form->bindRequest($request), then immediately grab and use the raw POST data - they don't quite understand still what's going on.

Thoughts?

@mdpatrick
Copy link
Contributor Author

@weaverryan I'm assuming this issue (your third bullet point) primarily seen with the original Symfony instead of Symfony2? I'm not sure that I've even seen mention of this method of getting POST values in the docs, so I'm surprised that new users would experience that confusion otherwise.

Made another commit with a bit more of a warning. I personally prefer erring on the side of too much information instead of too little... but... if you think it should be scrapped, my feelings won't be hurt. :)

@mdpatrick mdpatrick closed this Oct 12, 2011
@mdpatrick mdpatrick reopened this Oct 12, 2011
weaverryan added a commit that referenced this pull request Oct 15, 2011
@weaverryan weaverryan merged commit b0204df into symfony:2.0 Oct 15, 2011
@weaverryan
Copy link
Member

Great! I think this is a good addition indeed :)

@mikaelrandy
Copy link

There is a display error with this update.
On the book page (http://symfony.com/doc/current/book/forms.html#using-a-form-without-a-class), the php code in the tip is not display

@mdpatrick
Copy link
Contributor Author

Weird, I'll add a commit to add some whitespace to see if that fixes it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants