Skip to content

added docs about child forms customization #2998

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

Merged
merged 1 commit into from
Oct 7, 2013

Conversation

youbs
Copy link
Contributor

@youbs youbs commented Sep 18, 2013

Q A
Doc fix? no
New docs? yes
Applies to 2.2+
Fixed tickets none

I was not aware that you could apply a form theme to a specific child until I asked Bernhard on twitter, and thought it could be useful to someone.
This is my first PR to symfony-docs, I hope it'll do.

@@ -298,6 +298,26 @@ When the ``form.age`` widget is rendered, Symfony will use the ``integer_widget`
block from the new template and the ``input`` tag will be wrapped in the
``div`` element specified in the customized block.

.. _cookbook-form-child-forms:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not really needed if you don't need to link to this section

@wouterj
Copy link
Member

wouterj commented Sep 18, 2013

One of the best first PRs!

one thing I'd like to see is php integration, I'll see if I can find how to do that (you can also do that when you have time)

@youbs
Copy link
Contributor Author

youbs commented Sep 18, 2013

Thank you for your feedback I'm glad you like it!

I never used pure PHP integration but I'll see what I can do

@stof
Copy link
Member

stof commented Sep 19, 2013

for the PHP templating, it will look like this:

$view['form']->setTheme($form['child'], 'AcmeDemoBundle:Form/Child');

@youbs
Copy link
Contributor Author

youbs commented Sep 19, 2013

Thanks @stof

weaverryan added a commit that referenced this pull request Oct 7, 2013
added docs about child forms customization
@weaverryan weaverryan merged commit 1d4b48f into symfony:2.2 Oct 7, 2013
weaverryan added a commit that referenced this pull request Oct 7, 2013
@weaverryan
Copy link
Member

Thanks Hubert! I think this is a great addition, and highlights the meaning of the form variable in form_theme.

Cheers!

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.

4 participants