Passionate Engineer
Passionate Engineer

Reputation: 10412

Cakephp how to get callback validation error message from model

I'm trying to get validation error message from model and display this in json output. Is there a way we can catch this callback in variables?

Upvotes: 3

Views: 10947

Answers (1)

mark
mark

Reputation: 21743

you can access the validation messages in the controller:

$errors = $this->Model->validationErrors;

then you can use it for whatever you like

Upvotes: 17

Related Questions