Git Product home page Git Product logo

kirby-flash's People

Contributors

jevets avatar mzur avatar s3ththompson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

s3ththompson

kirby-flash's Issues

Support flash "now" parameter, for saving information for current requests

kirby-flash works really well when I want to save a success message or an error for the next page load, and I return a redirect from a controller.

However, I'd like to use kirby-flash in situations where I render a 422 response immediately after a form error. In this case, I'd like the flash error message to show up in the response for the current request (and not the subsequent page load).

Rails has a similar pattern, and the flash object has a now method to support this use case.

Would you be open to this feature?

I think the cleanest API would probably be to support a 3rd, optional boolean argument called "now" on flash->set() and the flash helper. Under the hood, this would store the data in a separate temporary array on the Flash instance, which would not be persisted to the session. flash and flash->get() would read from both the session data and the temporary data when looking for a key.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.