Validation and messages · Question 1 of 12
Which method creates a flash message in an Extbase controller?
1 answer is correct. Easy
Show answer
Answer
- B $this->addFlashMessage()
Explanation
Flash messages are short feedback messages such as "The entry has been saved." that are shown to the user once. In an Extbase controller you create them with $this->addFlashMessage('Saved', 'Success', ContextualFeedbackSeverity::OK);; by default they are stored in the session and therefore also survive a redirect. In the Fluid template, the ViewHelper <f:flashMessages /> outputs all pending messages and then removes them from the queue. Passing a variable with $this->view->assign() would only work for the current view and would be lost after a redirect.