Welcome Guest, Not a member yet? Register   Sign In
error in validation documentation?
#1

I've been reading the documentation on validation, (https://codeigniter4.github.io/userguide...ation.html) and following the mini-tutorial. But it results in an error: "Undefined property: App\Controllers\Form::$validation".

In the Form.php controller, shouldn't
Code:
'validation' => $this->validation

be

Code:
'validation' => $this->validator
?

I'm very new to codeigniter, so apologies if I'm misunderstanding something!
Reply
#2

I think you are right! "validator" is a controller property, and makes sense here.
Thanks for pointing it out Smile
Reply
#3

I think it could be understood both ways.

Indeed, $this->validator is not instanciated before calling validate(...).

Is not the documentation more about "instanciating an object in variable $validation and play with it"? Not very clear...
Reply




Theme © iAndrew 2016 - Forum software by © MyBB