How in YII 2 to place one form on all pages?

There is a problem, you need to place a form adding a text string on all pages. But the form requires a model, and that would place it in the layout needed to add a crutch, tell me how to do it right.
<? if (!$model) {
 $model = new \app\models\Name();
 $form = ActiveForm::begin(['action' =--> '/name/search/']);
 } else {
 $form = ActiveForm::begin();
 }
September 19th 19 at 00:17
2 answers
September 19th 19 at 00:19
Solution
It makes no sense for such a simple form of one field to use ActiveForm. Then the model is not required.
September 19th 19 at 00:21
Make a widget

Find more questions by tags PHPYii