rule(TRUE, 'not_empty') ->rule('username', 'not_empty') ->rule('username', 'alpha_numeric') ->rule('username', 'matches', array('username', dataresource)) ->rule('password', 'not_empty') ->rule('password', 'matches', array('password', dataresource)) if($post->check()): //actie als t is gelukt else: //actie als het is mislukt endif; } }