On Fri, Oct 05, 2001 at 04:04:24PM -0500, Boex,Matthew W. wrote:
>I have 4 cgi's, each one with different states controlled by hidden params.
>I need a way to add html and don't want to add directly in the cgi with
>print statements.
Sounds as if you've come to the right place, then...
>I have multiple states within each cgi, different and shared html for each
>state. Should I create a shared template file ( for shared html), then a
>unique one ( for html unique to that state ), then call two objects in that
>state or should I just have one object and merge the shared and unique html
>in the template file?
I'm going to be really helpful here... "it depends". There are always
multiple ways to do things in Perl, and the best choice will vary. Having
said that, I'd probably do something like:
(in the CGI program)
(set $state by whatever means you usually do)
$tmpl->param("state.$state" => 1);
(in the template)
(common code)
<TMPL_IF NAME=state.1>
(stuff unique to state 1)
</TMPL_IF>
<TMPL_IF NAME=state.2>
(stuff unique to state 2)
</TMPL_IF>
(and so on)
As a general rule, it's less trouble and more flexible to use a single
H::T object.
Roger
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]