How can I edit the _search view (which is implemented by Yii2 Crud Generator), so that I can make two form fields on the same line? (Note that I have resized the form fields to 500px so that they can fit one line). Also, I would like the 'Search' and 'Reset' buttons to be on the same line too.
1 Answer
You can use options and assign eg: a proper twitter-bootstrap grid width
this way :
<?php echo $form->field($model, 'your_filed', ['options' => ['class' => 'col-md-4', ]]) ?>
5 Comments
Ragheb AlKilany
Thanks again :D I used it and it worked but if it could work, i need search and reset buttons on the same line as the fields, and 'create car' on another line. @scaisEdge
ScaisEdge
I see the layout. you must insert a div for break after the two field or enlarge the width of the field eg: md-6 for a better display
Ragheb AlKilany
I really appreciate everything man :) But what should I do to make the buttons on the same level as the fields , and not the fields' labels? @scaisEdge
ScaisEdge
The problem lies in the fact that the earch and reset buttons are placed in
<div class = 'form-group'>. The form-group can take off without problems is just a way to format the page and at this point you can line up the buttons with the fields where such use col-md-1, or if the sum of the field col not ecced 12Ragheb AlKilany
Thanks a lot, I'm gonna try to find a solution for this myself.. Regards
