Duration of setFlashdata |
Hi in my controller if several condition are ok i do :
Code: session()->setFlashdata('success','Password correttamente inviata via Mail'); in view: Code: <?php if (session()->get('success')): ?> When success the page redirect correctly to user login ( that have the same code on view) but because $page_to_redirect are unset i have the error , session()->setFlashdata don't work only for one call ?
Hi, i'm not a expert,
but session()->setFlashdata works for one call in theory (i believe) I don't quite understand your description of the problem: "but because $page_to_redirect are not defined i have the error " what error ? If the page redirect correctly, you may put a if condition to the header but this type of redirection isn't the good type of redirection, in my opinion i would have done diferently
(11-24-2020, 06:59 AM)neoneeco Wrote: Hi, i'm not a expert, I use this code to reset password , i insert my email and submit if all it's ok im redirecting to $page_to_redirect set in controller user/login in this case , but in view user login there is the same code ( to show message and redirect if login it's ok) and because the variable (session()->get('success') are set in the second call also , but in the controller method user/login $page_to_redirect is not set i have the error . I can solve it with if (isset($page_to_redirect) ) but i dont know why the session variabile is set on redirect... |
Welcome Guest, Not a member yet? Register Sign In |