[Catalyst] Re: Handy shotcuts
J. Shirley
jshirley at gmail.com
Thu Mar 20 15:21:50 GMT 2008
On Thu, Mar 20, 2008 at 7:05 AM, Michele Beltrame <mb at cattlegrid.info> wrote:
> Hi Aristotle!
>
>
> > But `uri_for` can take a lot more parameters than just one;
> > there's no reason you have to restrict your utility methods
> > to the first one.
>
> Also, it would be handy to be able to pass the status parameter (i.e.
> 303 is widely used) to res->redirect() when using these utlity methods
> as well.
>
> Michele.
>
> --
> Michele Beltrame
> http://www.cattlegrid.info/
> ICQ 76660101 - MSN mb at italpro.net
>
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
It seems more reasonable to have a slightly more intelligent utility method.
Something that sets the status to 303 if the request type is a post
(and HTTP 1.1 as Aristotle posted earlier, although I'm not sure what
the "best" way to check is. Assume it is unless stated otherwise, or
vice-versa?)
For now, rather than a plugin, I tend to create a redirect action that
I forward to. This works better for me in case my app ends up nested
somewhere that headers don't work as expected (like a Facebook
application). This way I can modify a singular controller action to
DTRT.
-J
--
J. Shirley :: jshirley at gmail.com :: Killing two stones with one bird...
http://www.toeat.com
More information about the Catalyst
mailing list