Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add documentation to overwrite token widget block using esi#10867

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@alexander-schranz
Copy link
Contributor

@javiereguiluz
Copy link
Member

@alexander-schranz I appreciate your contribution a lot and it shows how well you know Symfony!

However, I'm going to close it without merging it 😢 Let me explain why:

  • This doc repeats some concepts that are explained in other articles (such as creating custom form blocks and dealing with ESI fragments). We're working to reduce repetition in Symfony Docs to make them easier to maintain.
  • This doc is too detailed and low level ... it looks more appropriate for a tutorial outside of Symfony Docs.

However, thanks to your contribution we've made some improvements:

So, even if your contribution didn't make it this time, it helped us a lot to improve things and that's why I thank you for it. Cheers!

@alexander-schranz
Copy link
ContributorAuthor

alexander-schranz commentedJan 14, 2019
edited
Loading

@javiereguiluz thx for the kind words and your work on improving the documentation! What about the feature request (symfony/symfony#29862) should I document the token prefix somewhere else or do you mean its enough that the block_prefix is documented in the form docs (#10835) or will the feature PR also be closed?

@javiereguiluz
Copy link
Member

I like your PR in Symfony code and I hope it gets merged. Then, we need to merge#10835 and then we can think if we can add some note somewhere about this csrf token block prefix (maybe in security/csrf.rst).

Problem is that after#10835 I think we need to revamp the article about customizing form rendering. It's too complex and verbose and thanks to the latest improvements we can make it much better.

symfony-splitter pushed a commit to symfony/form that referenced this pull requestJan 16, 2019
This PR was squashed before being merged into the 4.3-dev branch (closes #29862).Discussion----------Add block prefix to csrf token field| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #...| License       | MIT| Doc PR        |symfony/symfony-docs#10867Currently I use the following code snippet to overwrite the token rendering:```twig{%- block hidden_widget -%}    {%- if form.vars.name == '_token' -%}        {{ block('app__token_widget') }}    {%- else -%}        {{ block('hidden_widget', 'form_div_layout.html.twig') }}    {%- endif -%}{%- endblock hidden_widget -%}{%- block app__token_widget %}    {{ render_esi(controller('SuluFormBundle:FormWebsite:token', { 'form': form.parent.vars.name })) }}{%- endblock app__token_widget -%}```With the change ofhttps://symfony.com/blog/new-in-symfony-4-3-simpler-form-theming this workaround can now be removed and the following can be used:```twig{%- block token_widget %}    {{ render_esi(controller('SuluFormBundle:FormWebsite:token', { 'form': form.parent.vars.name })) }}{%- endblock token_widget -%}```Commits-------02bd6893a5 Add block prefix to csrf token field
fabpot added a commit to symfony/symfony that referenced this pull requestJan 16, 2019
This PR was squashed before being merged into the 4.3-dev branch (closes#29862).Discussion----------Add block prefix to csrf token field| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | #...| License       | MIT| Doc PR        |symfony/symfony-docs#10867Currently I use the following code snippet to overwrite the token rendering:```twig{%- block hidden_widget -%}    {%- if form.vars.name == '_token' -%}        {{ block('app__token_widget') }}    {%- else -%}        {{ block('hidden_widget', 'form_div_layout.html.twig') }}    {%- endif -%}{%- endblock hidden_widget -%}{%- block app__token_widget %}    {{ render_esi(controller('SuluFormBundle:FormWebsite:token', { 'form': form.parent.vars.name })) }}{%- endblock app__token_widget -%}```With the change ofhttps://symfony.com/blog/new-in-symfony-4-3-simpler-form-theming this workaround can now be removed and the following can be used:```twig{%- block token_widget %}    {{ render_esi(controller('SuluFormBundle:FormWebsite:token', { 'form': form.parent.vars.name })) }}{%- endblock token_widget -%}```Commits-------02bd689 Add block prefix to csrf token field
@alexander-schranz
Copy link
ContributorAuthor

@javiereguiluz thank you! I at least created an issue for this:#10884

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@alexander-schranz@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp