Home > Enterprise >  how to render symfony4 forms with same classes as symfony3?
how to render symfony4 forms with same classes as symfony3?

Time:08-24

In symfony 3 the forms were rendered with the classes "control-label" for the label element and "form-control" for the input element, and both wrapped in a div with the class "form-group" like this:

<div >
<label  for="hazardlogbundle_acrgroup_serial">Serial</label>
<input type="number" id="hazardlogbundle_acrgroup_serial" name="hazardlogbundle_acrgroup[serial]" >
</div>

In symfony4 however, all three of these classes have been omitted, the same form now looks like this:

<div>
<label for="hazardlogbundle_acrgroup_name" >Grupp (ATS) namn</label>
<input type="text" id="hazardlogbundle_acrgroup_name" name="hazardlogbundle_acrgroup[name]" required="required" >
</div>

I happened to use these three classes (or actually, bootstrap did) for my css styling

  • Related