[TYPO3-50-general] Discussion: Flash Messages

Sebastian Kurfürst sebastian at typo3.org
Sun Jul 5 21:56:53 CEST 2009


Hey,
while reviewing FLOW3 MVC, I came across some more interesting places  
which I feel need discussion :-)
This mail is about the implementation of flash messages.

There are the *FlashMessage() methods in AbstractController. I somehow  
feel that they are out of place there. Additionally, it'd be  
interesting why you chose to use a stack which can be pushed one by  
one, but popped only all arguments at the same time. I would think  
that a single "flash message string" should be enough? (But I guess I  
miss an obvious point here ;-) )

Additionally, inside "resolveView()" of ActionController, you assign  
the variable "flashMessages" to the View. I am not sure if this is a  
nice way to push the flash messages to the View, as the user must know  
about a variable named "flashMessages" and has to always include a  
custom for loop which loops over all flash messages.
Alternatively, one could write a specialized "flash message"  
ViewHelper, which gets its information from the  
ViewHelperVariableContainer. Additionally, I think it'd make sense to  
provide a new (@internal) method in TemplateView called  
"setFlashMessage" - so it is all more clearly at one place, and there  
will be no "special" variables in the view.
I feel the second way of doing things would be a lot nicer as it is  
all more explicit and less "magic".


Thanks for your comments, and greets,
Sebastian
--
Gimme five!



More information about the TYPO3-project-5_0-general mailing list