HTML::Template::ExThe Perl code is operated in the template for HTML::Template | |
Download |
HTML::Template::Ex Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Publisher Name:
- Masatoshi Mizuno
- Publisher web site:
- http://search.cpan.org/~lushe/
HTML::Template::Ex Tags
HTML::Template::Ex Description
The Perl code is operated in the template for HTML::Template HTML::Template::Ex is a Perl module that offers the function to evaluate the Perl code to the template that HTML::Template uses.SYNOPSIS package MyProject; use CGI; use Jcode; use HTML::Template::Ex; my $cgi = CGI- >new; my $self= bless { cgi= > cgi }, __PACKAGE__; my $template= < < END_OF_TEMPLATE; < html > < head >< title >< tmpl_var name="title" >< /title >< /head > < body > < tmpl_set name="title" value="HTML::Template::Ex" > < h1 >< tmpl_var name="page_title" >< /h1 > < h2 >< tmpl_var name="title" >< /h2 > < div style="margin:10; background:#DDD;" > < tmpl_ex > my($self, $param)= @_; $param- >{page_title}= 'My Page Title'; return $self- >{cgi}- >param('name') || 'It doesn't receive it.'; < /tmpl_ex > < /div > < div style="margin:10; background:#DDD;" > < tmpl_loop name="users" > < div > < tmpl_var name="u_name" escape="html" > : < tmpl_var name="email" escape="html" > < /div > < /tmpl_loop > < /div > < tmpl_ex name="users" > return ; < /tmpl_ex > < tmpl_var name="env_remote_addr" > < body >< /html > END_OF_TEMPLATE my $tmpl= HTML::Template::Ex- >new($self, { setup_env= > 1, scalarref= > \$template, encoder = > sub { Jcode- >new($_)- >euc }, # ... other 'HTML::Template' options. }); print STDOUT $cgi- >header, $tmpl- >output; Requirements: · Perl
HTML::Template::Ex Related Software