HTMLTMPL

Merges runtime data with static HTML template file
Download

HTMLTMPL Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Ian Steel
  • Publisher web site:
  • http://search.cpan.org/~isteel/

HTMLTMPL Tags


HTMLTMPL Description

Merges runtime data with static HTML template file In an ideal web system, the HTML used to build a web page would be kept distinct from the application logic populating the web page. HTMLTMPL is a Perl module that tries to achieve this by taking over the chore of merging runtime data with a static html template.The HTMLTMPL module can address the following template scenarios : * Single values assigned to tokens * Multiple values assigned to tokens (as in html table rows) * Single pages built from multiple templates (ie: header, footer, body) * html tables with runtime determined number of columnsAn html template consists of 2 parts; the boilerplate and the tokens (place holders) where the variable data will sit.A token has the format __tokenName__ and can be placed anywhere within the template file. If it occurs in more than one location, when the data is merged with the template, all occurences of the token will be replaced. < p > My name is __userName__ and I am aged __age__. My friends often call me __nickName__ although my name is __userName__.When an html table is being populated, it will be necessary to output several values for each token. This will result in multiple rows in the table. However, this will only work if the tokens appear within a repeating block.To mark a section of the template as repeating, it needs to be enclosed within a matching pair of repeating block tokens. These have the format __x_blockName__. They must always come in pairs. and I have the following friends < table > __x_friends__ < tr > < td >__friendName__< /td >< td >__friendNickName__< /td > < /tr > __x_friends__ < /table > Requirements: · Perl


HTMLTMPL Related Software