Welcome Guest, Not a member yet? Register   Sign In
Do you know withInput() and Validation errors?
#1

(This post was last modified: 08-17-2022, 05:16 AM by kenjis.)

redirect()->withInput() and Validation errors have an undocumented behavior.

If you redirect with withInput():
PHP Code:
if (! $this->validate($rules)) {
    return redirect()->back()->withInput();

https://github.com/kenjis/ci4-validation...hp#L53-L55

You can use the Validation object with the validation errors in the previous page.
PHP Code:
<?= service('Validation')->listErrors() ?>
https://github.com/kenjis/ci4-validation...rm2.php#L7

But this feature has bugs or design flaw.
So I would like to remove the feature, and add a new helper function to get the validation errors.

Any opinion?
Reply


Messages In This Thread
Do you know withInput() and Validation errors? - by kenjis - 08-16-2022, 10:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB