if ($user->values($_POST)->check())
{
$user->save();
} else {
// How can i get the errors?
}
Any idea how that works?
Thanks in advance!
if ($user->values($_POST)->check())
{
$user->save();
} else {
// How can i get the errors?
}
Any idea how that works?
Thanks in advance!
Ah got it...
if ($user->values($_POST)->check())
{
$user->save();
} else {
$errors = $user->validate()->errors();
}
$user->_validate()->errors()
or
$user->validate()->errors()
depending on the version you're using.
Or, you can add a method in application/classes/orm.php with this;
class ORM extends Kohana_ORM {
public function errors($file = 'validate', $translate = TRUE)
{
return $this->_validate->errors( $file, $translate );
}
}
and than call errors with $user->errors() , which I find a lot easier