Skip to content

Instantly share code, notes, and snippets.

@rnsk
Created December 18, 2013 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnsk/8030509 to your computer and use it in GitHub Desktop.
Save rnsk/8030509 to your computer and use it in GitHub Desktop.
// エラーチェック
$err_flag = false;
$err_mes = array();
if (!$this->Model->saveAll($this->request->data, array('validate'=>'only'))) {
$err_flag = true;
$errors = $this->Model->validationErrors;
foreach ($errors as $error) {
$err_mes[] = $error[0];
}
$err_mes = Set::flatten($err_mes);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment