Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Model validator field message

Hi, I'm using this https://docs.phalconphp.com/en/latest/api/Phalcon%5Mvc%5Model%5Validator%5Uniqueness.html to check in the databse if an email already exist but I can't get the error message "Value of field 'email' is already present in another record". It works but I can't get the message of $this->flash->error($user->getMessages()); because this retuns me "Array". Do you have a solution for that ?



13.9k
Accepted
answer
edited Sep '15

Oh ! I solved my problem with that :

foreach ($user->getMessages() as $message) {
    $this->flash->error($message);
}

Instead of :

$this->flash->error($user->getMessages());