CodeIgniter Forums
Possible change POST before validation? - 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: Possible change POST before validation? (/showthread.php?tid=84947)



Possible change POST before validation? - motoroller - 11-26-2022

Possible change data POST before validation?
I did change in POST, after that make validaion but it comes with old data

Or how can i pass new Data to validation?


$validation->withRequest($_POST)->run();

I got Error
CodeIgniter\Validation\Validation::withRequest(): Argument #1 ($request) must be of type CodeIgniter\HTTP\RequestInterface, array given


RE: Possible change POST before validation? - kenjis - 11-26-2022

I recommend you use $this->validateData() in Controller.
See https://codeigniter4.github.io/CodeIgniter4/incoming/controllers.html#this-validatedata


RE: Possible change POST before validation? - kenjis - 11-27-2022

The same as $this->validate().
See https://codeigniter4.github.io/CodeIgniter4/incoming/controllers.html#this-validate