P
P
Pavel Khorikov2015-05-14 15:53:22
Yii
Pavel Khorikov, 2015-05-14 15:53:22

How to make a similar search form in Yii2 on Bootstrap?

How to make a search form similar to this one in Yii2?
The idea is to give the searcher the choice of which model to search for - the model of authors or the model of articles.
6fe84c65e384484c9eff9a1284ab116d.png
And, accordingly, how to pass the parameter of the selected model to the search () method?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Askar Fuzaylov, 2015-05-14
@Horik_off

Look here. bootsnipp.com/tags/search?page=2
Maybe you will find what you are looking for

A
Alexey Volegov, 2015-05-14
@EagleMoor

There is also a layout with handles through html, and then do what you want with it!
www.yiiframework.com/doc-2.0/guide-input-forms.html
And when accepting

actionSearch() {
  $form = new MyForm();
  $form->load($_POST); // or $form->load($_POST, '');  — в зависимости как параметры передавать будите
  if ($form->validate()) {
     ...
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question