Hi,
I want to add email id validation such that email id must be of same domain not other domain.
For this I have written below code -
$crud->set_table('ci_users');
$crud->set_subject('User');
$crud->fields('empcode', 'firstname','lastname','email','password');
$crud->required_fields('empcode', 'firstname', 'email', 'password');
$crud->set_rules('email', 'Email', 'validate_emailid');
and I have defined "validate_emailid" function in same controller like below -