Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Our app will have to figure out which button was hit and handle the data and output as needed. In C::A, there is really only one place you can put this logic: cgiapp_prerun(). If you have many runmodes that need this sort of functionalilty, your cgiapp_prerun() can start getting rather large. Why would you not have the runmode method handle this? I tend to use the runmode more as a vague indidactor of the expected action anyway - it determines the kind of checks that need to be done on the input, then decides which action to perform, and then refers to an output routine. Example:
This decides the output based on wether or not all data has been filled in correctly, but it isn't really very different if you check for a button instead.
update: after reading this thread again, it seems runmode != page != templateA runmode is just a hint from the calling form about what the input data is about, and what the application should to with it. It does not describe what template should be shown.
In reply to Re^2: Review: CGI::Prototype
by Joost
|
|