[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] Run modes structure and style


Hi,

The easiest way is to use separate modules for each of the major things,
search, browse, register etc.

And in each of these modules you have the necessary run modes.

To go between the scripts you simply call the instance script as a link, a
link with no run mode specified will go to be default run mode, or you can
specify the run mode through a parameter in the url.

i.e.

<a href="somescript.pl">some script</a>

for the default run mode

or

<a href="somescript.pl?rm=somerunmode">some script, calling some run
mode</a>

Adam

----- Original Message ----- 
From: "Dimitris Papaharisis" <suppressed>
To: <suppressed>
Sent: Monday, September 01, 2003 11:49 AM
Subject: [cgiapp] Run modes structure and style


> Hi list,
>
> I have recently started using C::A and I do like the idea of its structure
> and usage. I just cant seem to make it clear in my head how to structure
(or
> style) the runmodes to do what I want.
>
> Let's say I have a frontpage with several options such as register, logon,
> retrive password, search, category browse, add new item, admin functions
>
> I can add these in Project.pm / project.pl and the setup method would
> contain something along the lines of:
>
>    $self->run_modes(
>       'front_page' => 'front_page',
>       'category_browse' => 'category_browse',
>       'search' => 'search',
>       'item_add' => 'item_add',
>       'register' => 'register',
>       'logon' => logon,
> .
> .
> .
> etc.
>      );
>
>
> Now each of these runmodes might have sub-runmodes (for example register
> will have display_basic_register and display_full_register (as well as
> perform_basic_register and perform_full_register)). What do I do now? Do I
> scrap the register runmode from Project.pm and replace it with
> display_basic_register, display_full_register, perform_basic_register and
> perform_full_register?
>
> I m not very keen on this option since it would make more sense (and help
> maintainability) to have the registration sub-modes in a different .pm.
>
> Then even if I put the register sub-runmodes in a seperate .pm how do I
call
> it (use it? require it?) when I m in that run mode?
>
> The other option would be something along the lines of NOT having a
central
> Project.pm and just having the individual (e.g. Register.pm) module that
> call each other... In that case how do I move from one module to another?
Do
> I just do a POST with the new module as an action?
>
> Sorry for the length of the question. Just trying to get some opinions
from
> people that have developed medium / large size C::As with a large number
of
> modes.
>
> Thanks alot!!!
>
> --------------------------------------------------------------------------
--
> --------
> Legal Disclaimer: Internet email communications are not secure and
therefore
> Diva-Net does not accept legal responsibility for the contents of this
> message.
> Any views or opinions presented are solely those of the author and do not
> necessarily
> represent those of Diva-Net unless specifically stated.
>
>
>
>
> ---------------------------------------------------------------------
> 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
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.514 / Virus Database: 312 - Release Date: 29/08/2003


---------------------------------------------------------------------
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.