M
M
Messi2018-04-25 12:26:20
Yii
Messi, 2018-04-25 12:26:20

How to create a popup form?

Can you please tell me how to create an ajax form in a popup on a page?
There is a controller

public function actionIndex()
    {
            $form = new MyForm();
            if ($form->load(Yii::$app->request->post()) && $form->save()) {
                return true;
            } else {
                return $form->getFirstError('field');
            }

            return $this->render('index');
    }

How to make it right in the controller so that the page is loaded and the form receives an ajax response?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Beloborodov, 2018-04-25
@kowap

Here's someone straight for you washed down)) https://github.com/borodulin/yii2-modal-form

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question