CodeIgniter allows you to create multiple validation rules for a single form field, stacked together in order, and you can also preprocess the data of the form field at the same time. To set validation rules, you can use the set_rules() method:
$this->form_validation->set_rules();
The above method has three parameters: 1. Form domain name - it is the name you gave the form field. 2. The "humanized" name of the form field, which will be inserted into the error message. For example, if you have a form field called "user," you might give it a human-friendly name called "username." 3. Validation rules set for this form field. (Optional) When this form field sets a custom error message, if this parameter is not set, the default one will be used.
The solution for now is to use a secondary encapsulation library. Let’s change it to Chinese. We will see how the library is written later and then change it to internationalization
CodeIgniter allows you to create multiple validation rules for a single form field, stacked together in order, and you can also preprocess the data of the form field at the same time. To set validation rules, you can use the set_rules() method:
The above method has three parameters:
1. Form domain name - it is the name you gave the form field.
2. The "humanized" name of the form field, which will be inserted into the error message. For example, if you have a form field called "user," you might give it a human-friendly name called "username."
3. Validation rules set for this form field.
(Optional) When this form field sets a custom error message, if this parameter is not set, the default one will be used.
The solution for now is to use a secondary encapsulation library. Let’s change it to Chinese. We will see how the library is written later and then change it to internationalization