Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

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

Open
GeeH opened this issue Jun 28, 2016 · 1 comment
Open

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

GeeH opened this issue Jun 28, 2016 · 1 comment

Comments

@GeeH
Copy link
Contributor

GeeH commented Jun 28, 2016

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?


@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-mvc; a new issue has been opened at https://github.com/laminas/laminas-mvc/issues/24.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants