Created
November 29, 2010 18:39
-
-
Save rainerborene/720345 to your computer and use it in GitHub Desktop.
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 | |
// This is a basic function skeleton for | |
// customizing events with validation logic. | |
protected function __trigger() { | |
$validation = new Validation(self::ROOTELEMENT); | |
$rules = array( | |
'name' => 'required', | |
'email' => 'required|valid_email', | |
'username' => 'required', | |
'password' => 'required' | |
); | |
$labels = array( | |
'name' => 'Nome', | |
'email' => 'Email', | |
'username' => 'Usuário', | |
'password' => 'Senha' | |
); | |
$validation->setRules($rules); | |
$validation->setLabels($labels); | |
if ($validation->run()) { | |
# var_dump('It works'); | |
# exit; | |
} | |
return $validation->response(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I never even knew this was here! How can I have missed this one. Very good.