Skip to content

Instantly share code, notes, and snippets.

Created April 6, 2014 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/10011329 to your computer and use it in GitHub Desktop.
Save anonymous/10011329 to your computer and use it in GitHub Desktop.
User.php
<?php
class User extends ActiveRecord\Model {
static $validates_presence_of = [
['nome', 'message' => 'deve ser fornecido!'],
['telefone', 'message' => 'deve ser fornecido!']
];
public function validate() {
if($this->email == 'rod') {
$this->errors->add('email', 'this is not working');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment