Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds `flashAppend` as a configurable flash behaviour option #855

Merged
merged 1 commit into from May 3, 2018

Conversation

@neokoenig
Copy link
Member

neokoenig commented May 3, 2018

Add new configuration option: set(flashAppend=true) which then allows appending a flash value by default instead of replacing. Set to false by default; could make this true in future version maybe.

Stored in an array of strings, flashMessages() now checks to see if it's an array of strings or just a string and outputs appropriately.

Also means flashInsert() can be handed a simple one dimensional array.

I don't think this is a major breaking behaviour, as the functionality is hidden behind a flag and can be turned off; the only major difference is that you can now pass an array in as you couldn't before.

So useage if set(flashAppend=true) now can be:

flashInsert(success="One");
flashInsert(success="Two");

Or

msg=[
   "One", "Two"
];
flashInsert(success=msg);

Both of which would give you:

<div class=""flash-messages""><p class=""success-message"">One</p><p class=""success-message"">Two</p></div>

Note, doesn't currently support directly passing in an array when a key already exists.

`set(flashAppend=true)` to append a flash value by default instead of replacing. Stored in an array of strings. Also means `flashInsert()` can be handed a simple one dimensional array. Set to `false` by default; could make this true in future version maybe.
@neokoenig neokoenig requested review from perdjurner and chapmandu May 3, 2018
Copy link
Contributor

perdjurner left a comment

Awesome!

@andybellenie

This comment has been minimized.

Copy link
Contributor

andybellenie commented May 3, 2018

👍

@neokoenig neokoenig merged commit 3bc5922 into master May 3, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@neokoenig neokoenig deleted the flash-improvements branch May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.