first, not to sound like a teenager but HTML::Template is awesome.  i have
taken a large ( to me ) 600 line cgi's and crunched it down significantly.
i have also taken what would have been a nightmare of integrating html in my
cgi and replaced with something much easier.

i still have a couple questions.  first, i have only used staroffice to put
together web pages.  when i load a template with template tags, star office
changes the template tags.  is there an editor out there for linux that
won't do this.

second, i am still a little fuzzy on the associate option.  i have a bunch
of hidden tags i want to print out.  here is how i do it with cgi -

foreach my $param ($q->param()) {
  print $q->hidden(-name=>"$param")  if ($q->param ne 'page');
}

what would be the syntax, using the associate option, to send a hidden param
to my HTML::Template?  is this correct ??? is there a better way?? 

my $q=new CGI;
my $template = new HTML::Template(filename=>'template.tmpl', associate=>$q);

foreach my $param ($q->param()) {
$q->param(hidden => "$param");
}
print $template->output();

matt

-----Original Message-----
From: Philip S Tellis [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 08, 2001 11:55 PM
To: Boex,Matthew W.
Cc: 'HTML::Template List'
Subject: RE: [htmltmpl] another question


On Mon, 8 Oct 2001, Boex,Matthew W. wrote:

> I was able to get it to work not using the associate option.
>
> $template->param(start_form=>$q->start_form);
> $template->param(fname=>$q->textfield(-name=>"fname");
> $template->param(submit=>$q->submit(-name=>"go");
> $template->param(end_form => $q->end_form);

Don't do this either.  Stick to the associate option, but set the cgi
params explicitly.  Don't make new ones.

my $q=new CGI;
my $template = new HTML::Template(filename=>'template.tmpl',
associate=>$q);

$q->param('fname' => 'value_of_fname', 'lname' => 'value_of_lname' ...);

Philip

-- 
Forget it, Marge, it's Chinatown!

                -- Homer Simpson
                   Secrets of a Successful Marriage


Visit my webpage at http://www.ncst.ernet.in/~philip/
Read my writings at http://www.ncst.ernet.in/~philip/writings/

  MSN  philiptellis                         Yahoo!  philiptellis
  AIM  philiptellis                         ICQ     129711328

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to