Skip to content

Instantly share code, notes, and snippets.

@evercode1
Created January 1, 2015 03:10
Show Gist options
  • Select an option

  • Save evercode1/835bc1672f7cf0206d66 to your computer and use it in GitHub Desktop.

Select an option

Save evercode1/835bc1672f7cf0206d66 to your computer and use it in GitHub Desktop.
beforeValidate Profile Model Chap 8
public function beforeValidate()
{
if ($this->birthdate != null) {
$new_date_format = date('Y-m-d', strtotime($this->birthdate));
$this->birthdate = $new_date_format;
}
return parent::beforeValidate();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment