Elizabeth Vaughn wrote:
>
>
> This sounds promising. Here is my stumbling block. As I have tried to
> eleminate run_modes with embedded "action" function calls, I find that I am
> copying the same if-then-else tree from run_mode to run_mode so that each
> can decide for itself which "action" function to call. When the were
> run_modes, I could take care of it by using a seperate run_mode param. Have
> you run up against anything similar?
Hmm. I don't think I've into that in a memorable way. I do use a few
<whispers>global variables<//whisper> to things i always want available:
%FORM -- CGI parameters
%SES -- session information
%CFG -- configuration options (more like constants really, they
shouldn't change at run time).
I can get to these from my run mode modules and my my data modules.
I think using OO in my data modules helped tackle a lot of if/else
statements. Many of my pages are meant to either be viewed staticly or
dynamically. On a static page, a link might be like:
page.cgi?category_id=3
but on a static page, it would be
/Goats_and_Chickens/index.html
So instead of using if/else all over the place to account for generating
content that is sometimes "dynamic" and sometimes "static", I have a
"mode" attribute as part of my constructor, which keeps track of which
mode I want. Since this defaults to $FORM{mode}, sometimes I don't even
have to set it at all.
The demo site for Cascade is here:
http://cascade.skatepark.org/demo.cgi/
-mark
. . . . . . . . . . . . . . . . . . . . . . . . . .
Mark Stosberg Principal Developer
[EMAIL PROTECTED] Summersault, LLC
v: 765-939-9301 ext 223 website development
. . . . . http://www.summersault.com/ . . . . . . .
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]