atelierdisko / li3_flash_message
The Flash Message plugin for Lithium provides a straightforward interface for displaying status messages to the user.
Installs: 2 052
Dependents: 12
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 17
Open Issues: 0
Type:lithium-library
Requires
- php: ^5.5.14 || ^7
- composer/installers: ^1
- unionofrad/lithium: ^1.1
This package is auto-updated.
Last update: 2020-11-22 20:43:06 UTC
README
The Flash Message (li3_flash_message
) plugin provides a straightforward
interface for displaying status messages to the user.
Installation
The preferred installation method is via composer. You can add the library as a dependency via:
composer require <AUTHOR>/<PROJECT NAME>
li₃ plugins must be registered within your application bootstrap phase as they use a different (faster) autoloader.
Libraries::add('li3_flash_message')
The official manual has more information on how to register the plugin with the app or use alternative installation methods (i.e. via GIT).
Usage
Inside the controller messages can be queued up using the write()
method.
FlashMessage::write('The post has been saved.');
Inside the view flash messages can be shown using the element.
<?= $this->flashMessage->show() ?>
Goals
- Use existing session storage
- Eliminate message content from controllers
- Easily localize messages
- Use filters to integrate into existing workflow
Copyright & License
Copyright 2010 Michael Hüneburg. All rights reserved. Copyright 2012 Union of RAD. All rights reserved.
This library is distributed under the terms of the BSD 3-Clause License. The full license text can be found in the LICENSE.txt file.