Mailing List Archive

RFC for non-plugin ways of doing this...
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

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: RFC for non-plugin ways of doing this... [ In reply to ]
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


_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev