Created
January 1, 2015 03:10
-
-
Save evercode1/835bc1672f7cf0206d66 to your computer and use it in GitHub Desktop.
beforeValidate Profile Model Chap 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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