[eluser]N.S.G.[/eluser]
Hi there,
I'm developing an application and right now I'm writing a message class to store messages in ("Your post was succesfully updated" and such) and have them shown to the user.
At first I used a library with a messages[] array, which worked fine as long as I stayed in the same controller but now the situation occurs that I have to switch to another controller using redirect(). So for example: updating a post in the "post" controller, and then redirecting to the "user" controller to show the user dashboard (where I want to display "post updated succesfully".
Now I figured I'd just put the messages array in a session, problem solved, but that doesn't seem to work because I can't call sessions from a library (nor from a helper).
How should I solve this? (I figure I can copy my set_message() and get_messages() functions in every controller but that'd be inconvenient).
! I just answered my own question: I could put these functions in the basic controller and have all other controllers extend from that one. Still: do you think that would be the best solution?
Thanks!