$val->add_field('field', 'some field', 'trim|required|callback_some_function);
It looks like you're new here. If you want to get involved, click one of these buttons!