M
M
Mikha Pankratov2015-03-13 18:22:28
Yii
Mikha Pankratov, 2015-03-13 18:22:28

What should be written in the response (on error) in the controller in ActiveForm?

Good day,
I developed an ActiveForm form that is called by a popup,
sends data to the controller, where they are processed and everything is done correctly.
But if the error is what to send back to me so that it just selects the desired input, as in client validation.
at the moment I send

return \yii\helpers\Json::encode($model->getErrors());

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikha Pankratov, 2015-03-14
@frmax

https://github.com/yiisoft/yii2/blob/master/docs/g...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question