Download the PHP package dotkernel/dot-flashmessenger without Composer
On this page you can find all versions of the php package dotkernel/dot-flashmessenger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dotkernel/dot-flashmessenger
More information about dotkernel/dot-flashmessenger
Files in dotkernel/dot-flashmessenger
Package dot-flashmessenger
Short Description Dotkernel flash messenger component for session messages between redirects
License MIT
Homepage https://github.com/dotkernel/dot-flashmessenger
Informations about the package dot-flashmessenger
dot-flashmessenger
Flash messenger library for session messages between redirects. A flash message, or session message is a piece of text data that survives one requests(available only in the next request). This library accepts session data as well, not just string messages, with the same behaviour. The flash messenger is a convenient way to add data to the session and get it back on the next request without bothering with setting and clearing the data manually.
Documentation
Documentation is available at: https://docs.dotkernel.org/dot-flashmessenger/.
Badges
Installation
Run the following command in your project folder
This will also install laminas/laminas-session
as session handling is based on this library.
Next, merge the ConfigProvider
to your application's configuration
Configuration
Sets the session namespace to use for all flash messages and data
Usage
If following the installation step, you'll already have a FlashMessenger service in the service manager. Just inject this service in you classes, wherever you need flash messages.
Getting the service in a factory
Using the flash messenger service
To add and retrieve text messages
Adding general data, not just messages, has a different method for that, accepting data as key/value pairs
There are also some predefined namespaces, along with shortcuts to add a message in the predefined namespaces
using the methods:
FlashMessengerRenderer
A class that is able to parse the content of the flash messenger service in an HTML format. It uses the TemplateInterface to parse a partial, sending to the partial template the messages, the service and the renderer itself. There are also a twig extension provided in dot-twigrenderer, for easy parsing of messages blocks.
Registered services
The flash messenger service
The registered renderer class
All versions of dot-flashmessenger with dependencies
psr/http-message Version ^1.0 || ^2.0
laminas/laminas-servicemanager Version ^3.22.1
laminas/laminas-session Version ^2.17.0
mezzio/mezzio-template Version ^2.9.0