how to validate several models (parent model and child model) |
If one of the two does not validate, that neither insert data.
example: if($this->carsModel->save($data)) { if($this->carsItemsModel->save($dataItems)) { echo 1; } else { echo $this->carsItemsModel->errors(); } } else { echo $this->carsModel->errors(); } the problem is that if the item is not validated, however you want it inserts the parent. |
Welcome Guest, Not a member yet? Register Sign In |