FAQ
I try to adhere to best practices concerning GET and POST, as such, I
tend to do a lot of redirects after POSTs.

I wrote a simple plugin that gives me a ->message method that I can
stuff in status messages that follows (via flash) in case of a
redirect. If there is no redirect, the messages go to stash.

In my view, I could just iterate over both flash and stash to display
any status messages but that's not quite ideal either. In the case of
a serialized view that is entirely data-driven, I'd have to have
another step rather than just include the messages key in the stash.

I've thought of an ActionClass similar to DefaultEnd but that doesn't
get me the nice $c->message method. So, I could have a controller
base method but then I have the action class and a controller base
class, when the plugin (which does interact with the dispatch cycle to
inspect the response in case of redirect) seems reasonable.

Thoughts?

Thanks,
-J

Search Discussions

  • Ashley Pond V at Oct 16, 2008 at 12:54 am

    On Oct 15, 2008, at 4:40 PM, J. Shirley wrote:
    In my view, I could just iterate over both flash and stash to display
    any status messages but that's not quite ideal either. In the case of
    a serialized view that is entirely data-driven, I'd have to have
    another step rather than just include the messages key in the stash.
    The first part is what I do. I keep an array ref of "blurb"s which
    are simple template snippets. They can be additive this way too,
    only put into the stash or flash with push() so if there is something
    to say in the new page load (the stash) it gets added to the list of
    blurbs passed along by the redirect (the flash).

    It would be fun to see an intelligent built-in way of doing this.

    -Ashley

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst-dev @
categoriescatalyst, perl
postedOct 16, '08 at 12:40a
activeOct 16, '08 at 12:54a
posts2
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Ashley Pond V: 1 post Jay Shirley: 1 post

People

Translate

site design / logo © 2021 Grokbase