Form Validation Library - RoverWire/codeigniter-utilities GitHub Wiki

Official Codeginiter documentation form validation library reference

Configuration

Creates a base array for the form validation configuration

Trigger: ciformvalconf

Results:

$conf = array(
        array(
          'field' => '',
          'label' => '',
          'rules' => ''
        )
      );

$this->form_validation->set_rules($conf);

Configuration Rule

Creates a key array to be used within configuration array

Trigger: ciformvalrule

Results:

array(
  'field' => '',
  'label' => '',
  'rules' => ''
)

Form error

Calls a helper for the field error. You can customize the delimiters.

Trigger: ciformerr

Results: form_error('field', '<div class="error">', '</div>');

Run validation

Trigger: ciformvalrun

Results $this->form_validation->run();

Set error delimiters

Trigger: ciformvaldel

Results: $this->form_validation->set_error_delimiters('<div class="error">', '</div>');

Set message

Trigger: ciformvalmes

Results: $this->form_validation->set_message('field', 'message');

Set rules

Trigger: ciformvalset

Results: $this->form_validation->set_rules('field', 'label', 'required|trim');

Validation errors

This calls a helper to display form validation errors. The delimeters suggested can be modified or discarded.

Trigger: civalerr

Results: validation_errors('<div class="error">', '</div>');

⚠️ **GitHub.com Fallback** ⚠️