One thing that I do in my apps, especially now with the advent of
Plugin::AutoRunmode is to keep a config file set up with the
runmode/C::A subclass pairings.
So, for instance, if I know that I'm going to have my runmodes grouped
in some logical way (staff,client,siteAdmin for example) then I could
build three different C::A subclasses, one for each group, and then my
instance script does this:
my $module = ${$ds->config('runmodes')}{CGI::param('rm')};
unless ($module) {
$module = ${$ds->config('runmodes')}{defaultRunmode};
}
eval "require $module";
eval {
my $webapp = $module->new();
$webapp->run();
}
Which uses just the one instance script, and the overly complicated
config call in there is just to return the package name to use, based
on the runmode called.
This is just my way of keeping things logically separate. Works for
me, use it if you want. That relys on some sort of config parser, but
it could be done by just building a runmode hash in the instance
script.
Hope it helps!
caleb
On Thu, 9 Dec 2004 22:02:55 -0600, punkish <suppressed> wrote:
> I have been reading a good bit over at the cgiapp wiki. The write-ups
> on project directory layout were very instructive, and, as a result, I
> have a decent idea of how to go about organizing my files and folders.
> I can't, however, figure out the following --
>
> how does my url map to my various sub apps? Taking the example of a
> relatively common app which has a general public area, a members only
> area, and an admins only area, I would like my url to still stay
>
> http://myapp/index.cgi/do_something?based_on_this=that
>
> (I would probably hide 'index.cgi' from the above url via mod_rewrite,
> but that is not the point of this query).
>
> The above would imply that I would have only one index.cgi, hence one
> instantiation of my $public_app. How would I go about getting hold of
> the correct $member_app or $admin_app based on who is looking at my
> app (public or a common member or an admin)?
>
> I hope at least my question above is clear. If not, chide me.
>
> Many thanks in advance.
>
> --
>
> punkish
>
> ---------------------------------------------------------------------
> Web Archive: http://www.mail-archive.com/suppressed/
> http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: suppressed
> For additional commands, e-mail: suppressed
>
>
--
caleb
http://www.ruejulesverne.com
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.