How to change name attribut value from twig
Posted
by
taieb baccouch
on Stack Overflow
See other posts from Stack Overflow
or by taieb baccouch
Published on 2013-10-18T09:10:44Z
Indexed on
2013/10/25
15:54 UTC
Read the original article
Hit count: 170
I am using Symfony version 2.3 and twig version 1.0. and I'm trying to change the name attribut value. Here is my code :
<div class="control-group">
{{ form_label(form.menuTitle, null, {'label_attr': {'class': 'control-label'}}) }}
{{ form_errors(form.menuTitle)}}
<div class="controls">
<div class="span12">
{{ form_widget(form.menuTitle, {'attr': {'class': 'span6'}}) }}
</div>
</div>
</div>
The rendering code :
<div class="control-group">
<label class="control-label required" for="smart_contactbundle_contact_menuTitle">Menu title</label>
<div class="controls">
<div class="span12">
<input type="text" id="smart_contactbundle_contact_menuTitle" name="smart_contactbundle_contact[menuTitle]" required="required" maxlength="255" class="span6">
</div>
</div>
</div>
I want to change name="smart_contactbundle_contact[menuTitle]"
to name="menuTitle"
© Stack Overflow or respective owner