1

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.

enter image description here

1 Answer 1

3

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', ]]) ?>
Sign up to request clarification or add additional context in comments.

5 Comments

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
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
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
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 12
Thanks a lot, I'm gonna try to find a solution for this myself.. Regards

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.