-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Customize an Individual field with camelCase name #3195
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
Comments
Just to clarify, the bug is that this block is never rendered. |
Does it work if you name the block "_adtype_image_file_row"? |
No, I tried "_adtype_image_file_row" as well as "_adtype_imagefile_row", but no luck. |
Any update on this issue? |
Not yet, I need to look into this. If you can dive into the code to find out what the generated block name is, I'd be very grateful. |
Alright, I'll take a look! |
I have only looked at this quickly but you might want to look at the folowing:
Calling is More details in the corresponding PR. Without this PR your template would have caused an infinite recursion. See this for an example of what the PR made possible. If this turns to be the root cause could you please:
|
Sorry guys, I found that the problem is that this field is rendered by a template included in my form... : {% include 'ProjectCoreBundle:Core:image_field.html.twig' with {
'fieldName': 'image',
'required': true,
'translatable': true
} %} But this brings me to another question, is it possible to override a collection label ? For example, I would like to do : {% block user_userroles_$$name$$_label %}
{% spaceless %}
{% set attr = attr|merge({'for': id}) %}
{{ block('generic_label') }}
{% endspaceless %}
{% endblock user_userroles_$$name$$_label %} But I get : Unexpected character "$" in ProjectUserBundle:User:edit_fields.html.twig at line 34 |
This is not an issue but a support request now so please read the doc, ask your question on the user list and if this turns to be an issue come back here.
(i don't have your reply on top of my head, the proto rendering has been changed by @marcw some time ago) |
Thanks for your support guys. |
I followed the documentation here : http://symfony.com/doc/2.0/cookbook/form/form_customization.html#how-to-customize-an-individual-field , it's working for all the fields I wanted to modify the display, except for one field that is named with camelCase.
The field :
The overrided block for this field :
In the same view, I defined individual blocks and it's working fine, except for this one. Working fields are the ones named in lowercase.
Exemple of a working field :
Am I doing something wrong?
Thanks!
The text was updated successfully, but these errors were encountered: