How to get old validation errors - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: How to get old validation errors (/showthread.php?tid=75617) |
How to get old validation errors - falko - 02-26-2020 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! RE: How to get old validation errors - MGatner - 03-01-2020 You should pass the error messages during the redirect, using "with($name, $content)", e.g.: https://codeigniter4.github.io/userguide/general/common_functions.html#redirect RE: How to get old validation errors - falko - 03-05-2020 (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/general/common_functions.html#redirect Ok. Thank you! But why they are saved as flash data? PHP Code: $validator = Services::validation(); RE: How to get old validation errors - falko - 03-08-2020 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! |