Which validation rule would you use to check if a data is in correct format?
date_format
correct_date
valid_date
valid_format
valid_date
Which validation rule would you use to ensure a field is exactly 10 characters long?
Group of answer choices
length_exact
exact_length
fixed_length
size_10
exact_length
How can you set a custom rule in CodeIgniter 4?
Group of answer choices
Define the rule in the view file
Use the setRule() method or define it in the configuration file
Set the rule in the database
Use the customRule() method
Use the setRule() method or define it in the configuration file
Which method is used to validate data in CodeIgniter 4?
Group of answer choices
validate()
confirm()
check()
verify()
validate()
Which method is used to retrieve a specific error message for a particular field?
Group of answer choices
retrieveError(‘field’)
showError(‘field’)
getError(‘field’)
fetchError(‘field’)
getError(‘field’)
Which validation rule would you use to ensure a field contains only numeric values?
Group of answer choices
is_integer
is_number
digits_only
numeric
numeric
How do you ensure a field is not empty and has a value in CodeIgniter 4?
Group of answer choices
non_empty
mandatory
required
filled
required
Where can validation rules be defined in CodeIgniter 4?
Group of answer choices
In the view files
In the controller or a validation configuration file
In the database schema
In the app/Views directory
In the controller or a validation configuration file
How do you specify validation rules directly in the model for CodeIgniter 4?
Group of answer choices
$validationRules property
$validateRules property
$modelRules property
$rules property
$validationRules property
How can you combine multiple validation rules for a single field?
Group of answer choices
Use a comma , between rules
Use a plus sign + between rules
Use an ampersand & between rules
Use a pipe | between rules
Use a pipe | between rules
What does the withInput() method do when validation fails in CodeIgniter 4?
Displays error messages
Redirects back with the old input
data
Clears the input fields
Saves the input data to the database
Redirects back with the old input data
Which validation rule checks if a field value exists in a set of values?
Group of answer choices
in_set
allowed_values
exists_in
in_list
in_list
How do you set custom error messages for validation rules in CodeIgniter 4?
Group of answer choices
Pass an associative array of rules and messages to the validate() method
Define them in the view file
Set them in the database
Use the errorMessage() method
Pass an associative array of rules and messages to the validate() method
How can you validate if a field matches another field in CodeIgniter 4?
Group of answer choices
matches
compare
match
equal_to
matches
Which method retrieves the validation error messages in CodeIgniter 4?
Group of answer choices
displayErrors()
showErrors()
getErrors()
getErrorMessages()
getErrors()
How do you apply validation rules to a specific field in a controller?
Group of answer choices
Use $this->applyRules(‘field’, ‘rules’)
Use $this->validation->field(‘rules’)
Use $this->validate([‘field’ => ‘rules’])
Use $this->setRules(‘field’, ‘rules’)
Use $this -> validate([‘field’ => ‘rules’])
Which built-in validation rule checks if a value is a valid email address?
Group of answer choices
valid_email
email_check
valid_email_address
email_valid
valid_email