Re: [Maypole] Redirecting after do_edit()

From: Peter Speltz (peterspeltz at yahoo.com)
Date: Fri Dec 31 2004 - 07:43:22 GMT


--- Drew Taylor <taylor.andrew.j at gmail.com> wrote:

> I'm firmly in the camp of preferring to do a redirect after running an
> action, ie do_edit(). But looking at Maypole::Model::CDBI, it doesn't
> look like there is an easy way to have it do a redirect instead of the
> template switcheroo. And I'm not sure how to do a redirect either for
> that matter. I'm surprised that Maypole doesn't have a built-in
> functionality to do this with everything else it does...
>
> I'd be happy to put together a patch for redirect(),
> and to patch
> do_edit() to take a config option to determine if it redirects or
> switches templates.
>
> Drew
> --

I've been working on a Maypole::Plugin::Redirect. I wrote this because I wanted
A) to say "return $r->redirect('table/action/')" to redirect ANYWHERE in my app
and not worry about objects, templates, etc.
B) And later in another request say "return $r->from_redirect()" and get back
to where i came from.

There's a short discussion on this in archives this month or last. I've
attached my module. For what you want to do it works very good. In do_edit you
would say something like: "return $r->redirect('mytable/list');" and it would
be just as if you hit a link to list (but no actual http request).

For some of the more advanced functionality, its still needs some work. Its a
good start though. I'd love some help with it and feedback and opinions and
ideas . . .

Thanks

> ----------------------------------------------------------------
> Drew Taylor * Web development & consulting
> Email: drew at drewtaylor.com * Site implementation & hosting
> Web : www.drewtaylor.com * perl/mod_perl/DBI/mysql/postgres
> ----------------------------------------------------------------
>
> _______________________________________________
> maypole mailing list
> maypole at lists.netthink.co.uk
> http://lists.netthink.co.uk/listinfo/maypole
>

=====
pjs

                
__________________________________
Do you Yahoo!?
Dress up your holiday email, Hollywood style. Learn more.
http://celebrity.mail.yahoo.com


_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT