Right now i have a FormType that contains the following:
$builder->add('name','text')
->add('save','submit',array('label'=>'Save', 'attr'=>array('class'=>'btn btn-primary')))
->add('reset','reset',array('label'=>'Reset Form', 'attr'=>array('class'=>'btn btn-warning')));
Right now i have a little bit of form themeing going on that renders the above as:
<form method="post" action="">
<input type="hidden" name="_csrf_token" value="*********" />
<div class="form-group">
<label class="col-4">Name</label>
<input type="text" name="form[name]" value="" placeholder="Name" />
</div>
<div class="form-group">
<input type="submit" name="form[save]" value="Save" class="btn btn-primary" />
</div>
<div class="form-group">
<input type="reset" name="form[reset]" value="Reset" class="btn btn-warning" />
</div>
</form>
However what I would like the output to be is:
<form method="post" action="">
<input type="hidden" name="_csrf_token" value="*********" />
<div class="form-group">
<label class="col-4">Name</label>
<input type="text" name="form[name]" value="" placeholder="Name" />
</div>
<div class="form-group">
<input type="submit" name="form[save]" value="Save" class="btn btn-primary" />
<input type="reset" name="form[reset]" value="Reset" class="btn btn-warning" />
</div>
</form>
Notice the buttons are in the same form group wrapper div. I want to know if there is a way to do this using only the FormType or editing the Form Theme. I dont want to change the views from using:
{{ form(form,{'method':'POST','attr':{'class':'form-horizontal'} }) }}
I am aware this can be accomplished if I render the buttons from the form in a custom manner.