• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.