P
P
Pavel Gogolinsky2014-08-20 09:50:52
Yii
Pavel Gogolinsky, 2014-08-20 09:50:52

How to see a validation error when saving a model?

Yii 1.1.15 I am
saving the model.
$model->save()
The model is not saved. Most likely, not all parameters satisfy the conditions in rules. How to see the error in order to find out the reason for the failure to save?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2014-08-20
@gogolinsky

According to Yii wagon and a small cart of documentation, have you tried looking in it first?
This is if you really have an error in the validation process. But just in case, check for beforeSave() hooks in the model. If you do not return true from there, then the model will not be quietly saved, there will be no validation errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question