Created
February 29, 2012 18:52
-
-
Save icambridge/1943493 to your computer and use it in GitHub Desktop.
Change the validation rules
This file contains 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
<?php | |
$user = User:create(); | |
// Get the validation rules. | |
$userModel = new User(); | |
$rules = $userModel->validates; | |
// Add new | |
$rules['password']['skipEmpty'] = true; | |
$rules['confirm_password'] = array( | |
'match', | |
'message' => 'The passwords need to match', | |
'other_field' => 'password', | |
'skipEmpty' => true | |
); | |
// Validate | |
if ($user->validates(compact('rules')) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment