[TYPO3-core] RFC #11684: Add support for flash messages in the backend
Ingo Renner
ingo at typo3.org
Wed Aug 19 11:43:15 CEST 2009
Steffen Kamper wrote:
Hi Steffen,
> i see, but that's needed as every message is a single object.
> Having a class as singleton could hold all the messages in an array
> without need to store in a session, having methods like addMessage,
> renderMessage, renderAllMessages etc.
> Saving in session only makes sense imho if you need them at later point.
> You see what i mean?
Which is the case already: You do need them at a later point!
Flash messages are added in one request and then displayed in the next
request. Thus you have to transfer them over from one request to the
other. As they aren't needed after that anymore it doesn't make sense to
keep them around any longer, the sessions (as many, if not all, other
implementations have found) is a perfect fit for that purpose.
So to sum this up again: The implementation is perfectly right the way
it is. Don't try to bend your brain in a way that you shouldn't. ;)
> following your example it would be something like:
> $this->doc->addMessage(...) with
might make sense, but I'm not fully convinced yet. I'll think about it.
Ingo
--
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2
More information about the TYPO3-team-core
mailing list