Welcome Guest, Not a member yet? Register   Sign In
redirect with input
#1

Best,

I have made an form with some input.
When the validation is not ok then you can use
PHP Code:
return redirect()->back()->withInput(); 
And in the form you can use "old"as value so the input field is automatic filled with the old value.

But i use model validation how can i send the errors with the return redict withinput.

I know there is another way but that is more code, i was wondering if it is possible.

André
Reply
#2

PHP Code:
return redirect()->back()->withInput()->with('errors'$this->validator->getErrors()); 

That is how Lonnie doe's it in his Myth/Auth I would download Myth/Auth and look at
the AuthController to see how Lonnie doe's this and alot more.

Myth:Auth
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(12-10-2019, 09:04 AM)InsiteFX Wrote:
PHP Code:
return redirect()->back()->withInput()->with('errors'$this->validator->getErrors()); 

That is how Lonnie doe's it in his Myth/Auth I would download Myth/Auth and look at
the AuthController to see how Lonnie doe's this and alot more.

Myth:Auth

Thanx,

With the help off Myth:Auth it works fine now.
It's a good project for leaning.

Andre
Reply




Theme © iAndrew 2016 - Forum software by © MyBB