Slim-Flash
Slim-Flash copied to clipboard
Returning message(s) stored for next request
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.
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.
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 forkey2
but there is nothing left after call tokey1
.