ROR-style Flash alerts in PHP

Although I didn't get to use Ruby on Rails in my job due to various factors I had to consider, I took some interesting concepts for the framework, namely the ROR-style flash alerts. These alerts are stored in cookies and are transferred between pages even on redirects. Pretty cool idea, so I wrote a replicate for this functionality in PHP.

Demo and the source code can be viewed here

Have fun :)

5 Responses to “ROR-style Flash alerts in PHP”

  1. Ivo Jansch Says:

    In the ATK framework, there's an atkMessageQueue to add messages to a queue, and an {atkmessages} Smarty plugin to display them on any later pageload, upon which they are removed from the queue.

    Messages are stored in the session, which allows for more flexible message handling (you can even pass around objects), and larger messages, than in a cookie.

  2. mike Says:

    You can't really compare a whole framework with this snippet of code :) But it's nice to know that the ATK framework has similar feature.

  3. Joseph Crawford Says:

    Could you re-post the source code and example? When I click the link I get a 404 error.

  4. mike Says:

    Joseph,

    thanks for pointing the problem out! Looks like I don't have the code on the server anymore :/ I wonder at what point I lost it.. hm.. I'll see what I can do about it!

  5. mike Says:

    Sorry guys, the page was lost in transition :) I have recreated the sample code (I use this code basically everywhere :) - and its available at the link pointed by this article.
    Have fun :)

Leave a Reply