Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Document disabling the usage of globally defined form themes #8495

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 2 commits into from
Nov 10, 2017

Conversation

emodric
Copy link
Contributor

@emodric emodric commented Oct 9, 2017

This PR documents the option to disable the usage of globally defined form themes. This is suggested as a feature in symfony/symfony#22610 (reviewed, but not yet merged)

@emodric emodric changed the base branch from master to 3.4 October 9, 2017 08:35
@xabbuh xabbuh added this to the 3.4 milestone Oct 9, 2017
fabpot added a commit to symfony/symfony that referenced this pull request Oct 13, 2017
…efault themes when rendering a form (emodric)

This PR was merged into the 3.4 branch.

Discussion
----------

[Form] [TwigBridge] Added option to disable usage of default themes when rendering a form

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | symfony/symfony-docs#8495

This adds a possibility to use `only` keyword in `form_theme` tag to disable usage of globally defined form themes, e.g.

`{% form_theme form with ['common.html.twig', 'form/fields.html.twig'] only %}`

Otherwise, in order to completely control the rendering of the forms (for example in custom admin interfaces), one would need to use a form theme which has all the possible twig blocks defined to prevent globally defined themes to interfere with the rendering.

`only` keyword is already used when including a Twig template to transfer only the variables which are explicitly defined in the `include` tag, so it seemed natural to use it here too.

This, of course, means that the user will need to manually `use` all of the templates that are required to render the form, including `form_div_layout.html.twig`

This issue is described in details over at Symfony Demo repo: symfony/demo#515

TODO:

- [x] submit changes to the documentation

Commits
-------

e0681f9 [Form] [TwigBridge] Added option to disable usage of default themes when rendering a form
@emodric
Copy link
Contributor Author

emodric commented Oct 16, 2017

@javiereguiluz @xabbuh This is ready for review since the related PR in Symfony is merged now :)

@weaverryan weaverryan merged commit 14ef7ae into symfony:3.4 Nov 10, 2017
weaverryan added a commit that referenced this pull request Nov 10, 2017
… form themes (emodric, javiereguiluz)

This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Document disabling the usage of globally defined form themes

This PR documents the option to disable the usage of globally defined form themes. This is suggested as a feature in symfony/symfony#22610 (reviewed, but not yet merged)

Commits
-------

14ef7ae Minor reword
8d45f83 Document disabling the usage of globally defined form themes
weaverryan added a commit that referenced this pull request Nov 10, 2017
@weaverryan
Copy link
Member

Thanks @emodric!

weaverryan added a commit that referenced this pull request Nov 10, 2017
* 3.4:
  parameter name typo
  [#8603] Rewording
  [BrowserKit] Updated Project URI of Goutte
  [#8495] Minor tweaks
  Update index.rst
  Update redirection_map
  Delete progresshelper.rst
  Minor reword in autowiring introduction
  Changed the title of a Doctrine article to avoid confusion
  Reworded the introduction of event listeners article
  Little typo error
  Update flex.rst
  Asset Component and absolute paths
  Grouped assets example
  Minor reword
  Mentioned the new case-sensitivity of container parameters
  Document disabling the usage of globally defined form themes
xabbuh added a commit that referenced this pull request Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants