0
How to write a custom form field on Symfony2? Since in this form should appear:
- A field of type Dropdown with the label City;
- Another field of the kind number alongside the label door number.
0
How to write a custom form field on Symfony2? Since in this form should appear:
0
You have two options:
1 - Manually place the fields inside the form and pick up the wall meters via $request inside the controller.
HTML
{{ form_start(form) }}
<select name='cidades'>
<option value="">Selecione a Cidade</option>
{% for cidade in cidades %}
<option value="{{cidade.id}}">{{cidade.nome}}</option>
{% endfor %}
</select>
{{ form_end(form) }}
Controller:
$request->request->get('cidades');
2 - Use Symfony default mode and work Form with Arraycollection.
Browser other questions tagged php symfony-2 symfony
You are not signed in. Login or sign up in order to post.