How to get old validation errors |
Hello!
I know that is possible to use the function old() to get items from a redirect()->withInput(). My doubt is: How to get old validation errors? Has a function for that? PHP Code: public function withInput() Thank you very much!
You should pass the error messages during the redirect, using "with($name, $content)", e.g.: https://codeigniter4.github.io/userguide...l#redirect
(03-01-2020, 08:54 AM)MGatner Wrote: You should pass the error messages during the redirect, using "with($name, $content)", e.g.: https://codeigniter4.github.io/userguide...l#redirect Ok. Thank you! But why they are saved as flash data? PHP Code: $validator = Services::validation();
Ok. I found it:
system/Validation/Validation.php:643 PHP Code: public function getErrors(): array It only works if session is active. Should not auto start the session here? Thank you! |
Welcome Guest, Not a member yet? Register Sign In |