[cgiapp] Multiple run modes

Mike Tonks fluffymike at googlemail.com
Wed Feb 6 17:51:10 EST 2008


Hi,

I'm looking at CGI::Application prior to use, and one thing is unclear to me.

I'll outline a little senario to demonstrate the question:

I have a simple app with four run modes - list, view, edit & update

list does what it say on the tin - lists records in a data table

view ditto, displays a single record

edit displays a form to edit (or add) a record

update sends the posted data to the database


In my example, I would like the update run mode to then call the view
run mode, rather then simply display a rather useless 'update
complete' message.

Is there a good way to do this with CA?  I  suppose a simple option is
to simply have update() call view() and return the results, but I
wondered if there was a preferred solution to this?

Another thought that occurred from scanning the docs would be to put
the update function in prerun, but this seems wrong somehow.

Thanks for any assistance,

mike


More information about the cgiapp mailing list