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

Skip to content

[TwigBridge] Reduces code duplication in form_div_layout #15148

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

Closed
wants to merge 1 commit into from
Closed

[TwigBridge] Reduces code duplication in form_div_layout #15148

wants to merge 1 commit into from

Conversation

snoob
Copy link
Contributor

@snoob snoob commented Jun 30, 2015

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

{{- attrname }}="{{ attrvalue }}"
{%- endif -%}
{%- endfor -%}
{{ block('attributes') }}
Copy link
Member

Choose a reason for hiding this comment

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

please add whitespace control there to be sure we don't add extra spaces by mistake if we add something else in the template (currently, spaces are removed because the previous and next elements are asking to remove them)

@snoob
Copy link
Contributor Author

snoob commented Jun 30, 2015

I am not sure I fully understood. I have to add spaceless tag in the attributes block? or around every call of this block?

@stof
Copy link
Member

stof commented Jun 30, 2015

@snoob no. {% spaceless %} is about removing all spaces between HTML tag in the output, which is not what we want (and has a performance impact, which is why we stopped using it). I asked about using Twig whitespace control to ensure that the spaces added for readability of the template don't end up in the output: http://twig.sensiolabs.org/doc/templates.html#whitespace-control

@stof
Copy link
Member

stof commented Jun 30, 2015

btw, this should not be done in the master branch (the master branch is the 3.0 branch, and the only work we do in it directly are the removal of BC layers which are breaking BC for 3.0). It should go in the 2.8 branch (which is the default branch of the repo btw)

@Tobion
Copy link
Contributor

Tobion commented Jun 30, 2015

I already proposed these changes but it was declined for performance reasons: #12148 (comment)

@snoob
Copy link
Contributor Author

snoob commented Jun 30, 2015

@stof : Ok thank you
@Tobion : I was wondering about performance impact also. I tried to search if someone already proposed these changes but i didn't find it. May i close this PR so?

@webmozart webmozart added the Form label Jun 30, 2015
@Tobion Tobion closed this Aug 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants