Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Nirvana through the templating yin yang (TT2 / CGI.pm)

by thraxil (Prior)
on Jun 18, 2003 at 15:37 UTC ( [id://266862]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $query = new CGI;
    my $template = HTML::Template->new(filename => 'template.tmpl',
                                       associate => $query);
    
  2. or download this
    sub selectify {
        my $values = shift;
    ...
            }
        } @{$values}];
    }
    
  3. or download this
    $template->param(some_loop => selectify(\@values,\@labels,[$query->par
    +am('some_param')]);
    
  4. or download this
    <select name="some_param">
    <tmpl_loop name="some_loop">
      <tmpl_include name="inner_loop.tmpl">
    </tmpl_loop>
    </select>
    
  5. or download this
    <option value="<tmpl_var name="value" escape="html">"<tmpl_if name="se
    +lected"> selected="selected"</tmpl_if>><tmpl_var name="label" escape=
    +"html"></option>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://266862]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-03-28 14:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found