Message
\nn\t3::Message()
Simplifies the use of FlashMessages.
In the backend: FlashMessages are automatically displayed at the top
\nn\t3::Message()->OK('Title', 'Infotext');
\nn\t3::Message()->ERROR('Title', 'Infotext');
In the frontend: FlashMessages can be output via ViewHelper
\nn\t3::Message()->OK('Title', 'Infotext');
\nn\t3::Message()->setId('top')->OK('Title', 'Infotext');
... or rendered as HTML and returned:
echo \nn\t3::Message()->render('above');
echo \nn\t3::Message()->render();
Overview of Methods
\nn\t3::Message()->ERROR($title = '', $text = '');
Outputs an "ERROR" flash message
\nn\t3::Message()->ERROR('Title', 'Infotext');
| @return void
\nn\t3::Message()->OK($title = '', $text = '');
Outputs an "OK" flash message
\nn\t3::Message()->OK('Title', 'Info text');
| @return void
\nn\t3::Message()->WARNING($title = '', $text = '');
Outputs a "WARNING" flash message
\nn\t3::Message()->WARNING('Title', 'Info text');
| @return void
\nn\t3::Message()->flash($title = '', $text = '', $type = 'OK', $queueID = NULL);
Saves a flash message in the message queue for frontend or backend.
| @return void
\nn\t3::Message()->flush($queueID = NULL);
Deletes all flash messages Optionally, a queue ID can be specified.
\nn\t3::Message()->flush('above');
\nn\t3::Message()->flush();
| @return array
\nn\t3::Message()->render($queueID = NULL);
Renders the Flash messages in the queue Simple example:
\nn\t3::Message()->OK('Yes', 'No');
echo \nn\t3::Message()->render();
Example with a queue ID:
\nn\t3::Message()->setId('above')->OK('Yes', 'No');
echo \nn\t3::Message()->render('above');
Output in the fluid via the ViewHelper:
{nnt3:flashMessages()}
| @return string
\nn\t3::Message()->setId($name = NULL);
Determines which MessageQueue is to be used
\nn\t3::Message()->setId('top')->OK('Title', 'Infotext');
Output in Fluid via ViewHelper:
{nnt3:flashMessages(id:'above')}
| @return void