Added: Create new refuel record
All checks were successful
Build and Deploy Zola Website / build_and_deploy (push) Successful in 13s
All checks were successful
Build and Deploy Zola Website / build_and_deploy (push) Successful in 13s
This commit is contained in:
@ -12,6 +12,15 @@ class Validator {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a field contains numbers
|
||||
*/
|
||||
public function number($field, $value, $message = null) {
|
||||
if(!is_numeric($value)) {
|
||||
$this->errors[$field] = $message ?? "$field must be an number";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a field meets minimum length
|
||||
*/
|
||||
@ -46,6 +55,10 @@ class Validator {
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
public function setErrors($errors) {
|
||||
$this->errors = $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if validation passed
|
||||
*/
|
||||
|
Reference in New Issue
Block a user