symfony - Select options are overwritten in symfony2 . How can i avoid that -


{% tablefield in tablefieldsarr %}   <tr>     <td>       <select>         <option name="{{ tablefield }}">{{ tablefield }}</option>       </select>     </td>   </tr> {% endfor %} 

i trying generate select box options each tr row above code getting select box 1 item in each row. how can fix it?

$tablefieldsarr comes controller.

you have move for loop inside select:

{% in 0..tablefieldsarr|length %}   <tr>     <td>       <select>       {% tablefield in tablefieldsarr %}         <option name="{{ tablefield }}">{{ tablefield }}</option>       {% endfor %}       </select>     </td>   </tr> {% endfor %} 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -