This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

[Suggestion] Making placeholder prototype_name available

About symfony tutorials, symfony book and API documentation.

[Suggestion] Making placeholder prototype_name available

by xDaizu » Tue Apr 07, 2015 11:05 am

Note to moderators: It's my first time in this forum, so I'm sorry if this is not the proper place to post this. I do this in with my best intentions, so feel free to move it to its proper place.

This is part question, part feature request. After a lot of dealing (and banging my head with the keyboard) with form prototypes I found the prototype_name option (I think it really should be better documented, or at least mentioned, in the How to Embed a Collection of Forms tutorial) but I think it would be a great idea to be able to communicate this option so my JS can properly deal with it. I'm still a Symfony2 newbie, so I dont pretend to know what is the best way to implement this, but it would be nice that in my twig template I could write something like

Code: Select all
    <ul id="activities_hidden_field" display="none" class="activities"[b] data-placeholder="{{ form_widget(form.activities.vars.prototype_name) }} [/b]data-prototype="{{ form_widget(form.activities.vars.prototype)|e }}"></ul>

so it's easier to write or maintain in case I change the placeholder name.

The part question is if this is somehow possible already. The part feature request is, if it doesn't exist, the suggestion of doing it.

Thanks for your attention.
Junior Member
Posts: 3
Joined: Tue Apr 07, 2015 10:55 am