Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by thraxil (Prior)
on Jun 18, 2003 at 15:37 UTC ( #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
Node Status?
node history
Node Type: note [id://266862]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-07-10 02:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (198 votes), past polls