Slim-Flash icon indicating copy to clipboard operation
Slim-Flash copied to clipboard

Returning message(s) stored for next request

Open pridit opened this issue 7 years ago • 2 comments

We have getMessages() which is returning from the previous request, and everything is a derivative of this. I want messages to be sent to the next request, but also retrieve them within the current logic I am doing prior to that for validation or otherwise.

I would need to be accessing $this->storage[$this->storageKey] to get anything currently stored for the next request.

Please let me know whether it's viable to add a new method to support this, or I am just being stupid and missing something overt that achieves what I'm aiming for.

pridit avatar Jan 29 '18 17:01 pridit

Just stumbled upon this issue. I am writing this pseudo code:

- validate many input fields
- if field is wrong - call `addMessage()`
- I thought I could know if there were problems with just polling flashMessages APIs... But there is no such method.

getMessages() returns data from previous/current request, but not ones queued for the next one.

lezhnev74 avatar Mar 05 '18 20:03 lezhnev74

I think I have the same problem. My process.

  • Page one call addMessage() for 2 messages (2 keys).
  • Page two call getMessage('key1'). The message display correctly but there is one more key left uncalled.
  • Page two make ajax request to get common pages data.
  • The common pages data controller call getMessage('key2') which is never call before. This should displaying message for key2 but there is nothing left after call to key1.

ve3 avatar Oct 07 '19 18:10 ve3