| (Top) < Using Templates (con't): | Using arrays with HTML::Template > |
Using HTML::Template and a template file 'start.tmpl':
<HTML>
<head><title>Welcome to St. Pat's Drink-o-Mat!</title></head>
<body>
<h1>Welcome to St. Pat's Drink-o-Mat!</h1>
<h2>Choose a drink type:</h2>
<form name='drink'>
<input type='hidden' name='mode' value='choose_brand'>
<TMPL_LOOP NAME="DRINK_TYPES">
<input type='radio' name='drink_type'
value='<TMPL_VAR NAME="value">'>
<TMPL_VAR NAME="label"><br>
</TMPL_LOOP>
<input type='submit'>
</form>
</body>
</HTML> |
Now, someone who edits this may have to know about the TMPL_VARs,
but doesn't have to know Perl just to change the <title>.
|
CGI::Application (v.2.0) |
26 |