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

(This post was last modified: 08-18-2022, 07:11 PM by luckmoshy.)

@kenjis of cause at earlier from CI 4.0 I didn't know what to do with redirect withinput back and get a specific error because of  CI documentation The global return
PHP Code:
redirect()->back()->withInput(); 
  was not shown any specific errors result method or how to get a specific error or succeeded reply from failed action query. So when you call this action, I totally agree with you that we should have errors resulting from the helper function than using a 
PHP Code:
<?= service('Validation')->listErrors() ?>
(validation) service in view or  Angel look we see we can get an errors to list ok and how about succeded result ?? or  Rolleyes is it formed for only errors result???!!!

@kenjis  I truly have been using this  global CI
PHP Code:
redirect()->back()->withInput(); 
  with additional fourth session methods like 
PHP Code:
redirect()->back()->withInput()->with('danger/*success*/',/*In modal*/$this->modal->errors() /*or something else apart with modal */); 
and then
PHP Code:
session()->get('danger/*success*/'); / 
in a view

but I may have a view of the point that it could be good if you design a new helper function and may have a specific single error validation result perimeter or with multiple validations on its parameter something like that or  this
PHP Code:
redirect()->back()->withInput(); 

in  additionally, Why this
PHP Code:
redirect()->back()->withInput(); 
if you have an app with a bulk of routes with
Code:
routes priority
it redirects back to an unintended route  so it's forcedly me to use
PHP Code:
redirect()->to(current_url())->withInput(); 
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply


Messages In This Thread
RE: Do you know withInput() and Validation errors? - by luckmoshy - 08-17-2022, 11:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB