You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say i have a user login view (site/login). On submit goes to a method (site/loginUser) and in that controller method I want to send the user back to site/login but with a message (in my case a error message to say they couldnt log in), how would i do that?
I tried making a public property called message in my controller and setting it in loginUser() method and then the login() method will check if its filled and so the view will show message, but this doesnt work as the class will create itself again when sent to location: site/login.
Currently I put everything in one controller method, this checks if form submitted, if error then add to error array and the view will show this. if form not submitted, show the view form.
Any ideas? thanks
The text was updated successfully, but these errors were encountered:
Hi @abdhass, this is the base of an MVC model, what happens is every request is redirected to index.php and then the MVC framework takes over. So you are right each time you request a page the MVC framework is run each time.
Saving variables can be done with files, cookies, session or a database. Depends on the type of content you need to store.
Hi
Say i have a user login view (site/login). On submit goes to a method (site/loginUser) and in that controller method I want to send the user back to site/login but with a message (in my case a error message to say they couldnt log in), how would i do that?
I tried making a public property called message in my controller and setting it in loginUser() method and then the login() method will check if its filled and so the view will show message, but this doesnt work as the class will create itself again when sent to location: site/login.
Currently I put everything in one controller method, this checks if form submitted, if error then add to error array and the view will show this. if form not submitted, show the view form.
Any ideas? thanks
The text was updated successfully, but these errors were encountered: