laminas / laminas-mvc-plugin-flashmessenger

Plugin for creating and exposing flash messages via laminas-mvc controllers
https://docs.laminas.dev/laminas-mvc-plugin-flashmessenger/
BSD 3-Clause "New" or "Revised" License
10 stars 16 forks source link

[ZF3] FlashMessenger: sort by datetime / multiple tagging #6

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7161 User: @ThaDafinser Created On: 2015-01-27T11:53:21Z Updated At: 2015-04-22T08:56:44Z Body Since the flashMessenger uses namespaces to group the messages, its impossible to sort the messages just by date.

I suggest to remove that limitation. Instead of grouping it in different arrays, maybe it would be better to store them in a single array.

To achieve the different types, maybe we could do that over "tagging". This could also enable mutliple tagging/routing to the right place...


Comment

User: @manuakasam Created On: 2015-03-27T17:13:21Z Updated At: 2015-03-27T17:13:21Z Body I'm against removing the namespaces because it eases grouping messages a lot. There's been many cases where I've used Namespaces on FlashMessages and found the feature incredibly useful.

However it shouldn't be this difficult to rewrite to have it ordered by date (per namespace though!)

Right now the code is:

$container->{$namespace}->push($message);

All the change required would be

$time = microtime(true) * 1000;
$container->{$namespace}->offsetSet($time, $message);

This however would dare a risk of overwriting messages (though quite low).

I'd rather see an additional FlashMessenger implementation like TimedFlashMessenger that simply does things a bit different. Thoughts?


Comment

User: @RalfEggert Created On: 2015-04-22T08:56:44Z Updated At: 2015-04-22T08:56:44Z Body Should be marked for ZF3 milestone, shouldn't it?



Originally posted by @GeeH at https://github.com/zendframework/zend-mvc/issues/178

samsonasik commented 4 years ago

I transfered the issue. Currently in laminas-mvc-plugin-flashmessenger