Answer the question
In order to leave comments, you need to log in
How to apply css for Symfony Form?
There is a template with html + css form, I need to convert the form to symofony form. There is a radio button in the form, initially it looked like this:
<div class="currency-label">
<input checked id="cur1" name="currency" type="radio">
<label for="cur1">RUB</label>
</div>
<div class="currency-label active">
<input id="cur2" name="currency" type="radio">
<label for="cur2">USD</label>
</div>
->add(
'vacancyCurrency',
ChoiceType::class,
[
'choices' => [
'usd' => 'USD',
'eur' => 'EUR',
],
'expanded' => true
]
)
{{ form_widget(form.vacancyCurrency, {'attr':
{'class': 'currency-label'}
}) }}
<div>
Answer the question
In order to leave comments, you need to log in
Posted an answer on Stackoverflow: https://stackoverflow.com/questions/57914944/how-t...
Instructions:
1. You need to access the field in the loop(In my case, through the related form)
Code of the view:
{% for systemItem in form.accountSetting.eprocurementSystemUsed.vars.form.children %}
<div>
{{ form_widget(systemItem) }}
{{ form_label(systemItem) }}
</div>
{% endfor %}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question