symfony - Symfony2 - Twig : Setting value of dropdown list using a twig variable -


this has been bugging me while...

i want pre-select value of dropdown list being rendered twig. want pre-populate using twig variable doesnt seem work.

heres code:

{{ form_widget(form.identifier,{value: "{{ magcode }}" }) }} 

the value of {{ magcode }} "dp". if manually type value in, works..

{{ form_widget(form.identifier,{value: "dp" }) }} 

does know if possible?

try,

{{ form_widget(form.identifier,{value: magcode }) }} 

you don’t need nest {{ ... }} delimiters. ones used wrap form_widget used print other variable contain.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -