Skip to content

Instantly share code, notes, and snippets.

@rainerborene
Created November 29, 2010 18:39
Show Gist options
  • Save rainerborene/720345 to your computer and use it in GitHub Desktop.
Save rainerborene/720345 to your computer and use it in GitHub Desktop.
<?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();
}
?>
@designermonkey
Copy link

I never even knew this was here! How can I have missed this one. Very good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment