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: 140

Filed under:
|

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

Related posts about symfony2

Related posts about twig

  • Another Twig Improvements

    as seen on Oracle Blogs - Search for 'Oracle Blogs'
    Hi all! We are here again to intorduce you some of our new NetBeans 7.3 features. Today we'll show you some another Twig improvements. So let's start! Code Templates First feature is about Code Templates. We added some basic templates to improve your Editor experience. You will be really… >>> More

  • Symfony2 Include in html in Twig

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I am developing an application usin Symfony2 and twig for templates. I am using a 3 level structure for templates. Base.html.twig, layout.html.twig and childtemplate.html.twig. The problem is I am trying to include one example.html (common html file) in the next child template by using include but… >>> More

  • Twig Code Completion

    as seen on Oracle Blogs - Search for 'Oracle Blogs'
    Hi all! After few weeks we have a new feature for you which will be available in upcoming NetBeans 7.3. It's about new code completion in Twig files! So let us introduce it a bit. Now we hopefully support all of Twig built-in elements. It means Tags, Filters, Functions, Tests and Operators… >>> More

  • Twig Template For loop Results

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I am trying to print out a the contents of an array but am not getting the expected results. any help is much appreciated: PHP code: $list[1]['first_name'] = 'Joe'; $list[1]['last_name'] = 'Smith'; $list[2]['first_name'] = 'John'; $list[2]['last_name'] = 'brand'; $data = array( 'customer'… >>> More

  • Twig templates, inheritances and block usage

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I've created three templates using Twig. The first one has block A defined in it, the second one extends from the first one, but includes a third template which sets the content of block A. When loading, through the browser, the url which renders b.html.twig, the content in block A (defined by the… >>> More