jnessier / flash Goto Github PK
View Code? Open in Web Editor NEWNOT MAINTAINED ANYMORE. Flash messages service for Slim 4 and similar PSR-15 compliant frameworks or apps.
License: MIT License
NOT MAINTAINED ANYMORE. Flash messages service for Slim 4 and similar PSR-15 compliant frameworks or apps.
License: MIT License
Hi
This morning I've tried to use your library and I fear that I stumbled on a simple bug: Flash::addMessage()
should add the message not set the key to the message...
The current code is
/**
* {@inheritDoc}
*/
public function addMessage(string $key, $message): FlashInterface
{
if (!isset($this->next[$key])) {
$this->next[$key] = [];
}
$this->next[$key] = $message;
return $this;
}
but adding the message should imo be:
$this->next[$key][] = $message;
Since you did define the return type of getMessages()
php gave me a nice error instead of simply returning the wrong data : - ).
I will keep on testing your library, but, for now, it seems to do its job!
I'm using FlashMessages with PHP 8.0.x and it works well.
Can you please update composer.json
to accept versions of PHP that are newer than 7.4?
As an example by setting
"php": ">=7.3"
or
"php": "^7.3 ||^8.0"
(supposing that it has not been tested with 8.1...
I normally plan to add the Flash Message to next.
But, I currently have one use case for messages that need to be rendered in the current session. And I'd prefer not to use a second library just for that...
I'd like to suggest to add addCurrentMessage
to Flash.php
.
(Of course I could use getCurrent()
and setCurrent()
but that's a huge hack!)
I can make a pull request if you agree with the idea.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.