Welcome Guest, Not a member yet? Register   Sign In
Call to undefined function validation ()
#7

(This post was last modified: 06-26-2021, 03:51 PM by Gary.)

$this->validation and $validation likely point to different things in your case.

Try using $this-> in all cases to reference the current instance of it... or using a local variable as a handle to the service that is then passed $this instance:

Code:
$validation = \Config\Services::validation();
...
$validationResult = $this->validate('validation_test');   // bool result

if ($validationResult) {
   // no validation errors
} else
   $validationErrors = $validation->getErrors();
// or $validation->getError('validation_test_specific_test_error');


Can be called in the View, if desired:
  echo $validation->getError('validation_test_specific_test_error');
Reply


Messages In This Thread
RE: Call to undefined function validation () - by Gary - 06-26-2021, 03:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB