[cgiapp] passing in a param from another runmode

Mark Fuller azfuller at gmail.com
Wed May 7 15:37:02 EDT 2008


On Wed, May 7, 2008 at 12:18 PM, Robert Hicks <sigzero at gmail.com> wrote:
> I have a runmode that goes back to "home" when finished:
>
>  $self->home;
>
>  I would like to send a flag back to "home" (0 for bad and 1 for good) so  a
> param in home can be set.

>From the runmode (method) you want to return back to home from, just
return the output of the home method, like "return
$self->home($err_code);" (assuming the home method does a
$tmpl_obj->output().).

The next problem is if you want the URL of the resulting page to look
like the user is on the home page (in case they bookmark it). If so,
you have to set the header_type to redirect (from the runmode (method)
you want to return to home) to cause the home runmode to be invoked.
If you want to pass a value, it would have to be on the URL as a
parameter, or kept as part of the session information for that
visitor, or stuffed in a cookie.

Maybe someone knows another way. That's the way I do it.

Mark


More information about the cgiapp mailing list