Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question for DRJ (Templates)

Status
Not open for further replies.

skiflyer

Programmer
Joined
Sep 24, 2002
Messages
2,213
Location
US
Since you always advocate the use of Templates, I was wondering if you had a favorite tutorial to point people towards regarding their use?

Personally I'm a big fan of having my code output everything, but I'm curious and want to make sure I'm making a fully educated decision.

Thanks!

Rob
 
skiflyer

This is a bit old, but it shows ths basics of a template class:


I don't use FasTemplate but a class that we've customized from a freely available template class.

Out customization we call ezTemplate. The features are:
- variable substitution with "safebraces" {!parameter!}
- parse associative array in 1 line (all placeholders corresponding to keys will we replaced)
- block definitions (for repeating sections)
- nested blocks
- remove/mark superfluous placeholders
- parse to browser
- parse full HTML into string
- parse extracted content

You can see an example of the template at work:

The same application is available to all departments.
SOmething like this is almost impossible to realize without templates.
Same application, different templates:
 
I'll check it out when I get home tonight, thanks for the information!

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top