Workshop: Introduction To Template::Toolkit

By Duncan Garland from Southampton.pm
Date: Saturday, 24 November 2012 12:20
Duration: 50 minutes
Target audience: Beginner
Language: English


5m Intro
10m Talk on TT
15m Exercises
10m Talk on TT
10m Exercises

This workshop is aimed at beginners. No knowledge of Template::Toolkit is assumed. You can probably get away with little or no knowledge of Perl, but I think you'll struggle if you haven't got any knowledge of programming at all.

The Template::Toolkit is a presentation language which allows you to separate the presentation aspects from the rest of the application. In web development this normally means separating the HTML and the styling from the heavy database accessing and data manipulation.

In the first 10 minute taught section I'll go through some slides. I'll take a simple mail-merge type letter with a few placeholders for "name" and the like. Then I'll gradually add some flow control, some boolean logic and show how to embed templates within other templates.

In the 15 minute "lab" section I'll give you some exercises which illustrate the points covered. I'll provide semi-completed Perl scripts so that you can concentrate on the templating.

In the second taught session, I'll show how to use a wrapper to add a standard header and footer. I'll show some slightly more complex data structures. I show how filters can be used for encoding HTML and vmethods to sort lists or count elements.

In the final lab session I'll provide some more exercises.

That's all we'll have time for. We'll have only scratched the surface of Template::Toolkit. There is an excellent O'Reilly book, http://search.oreilly.com/?q=Template%3A%3AToolkit&x=0&y=0, and a wealth of documentation on CPAN, http://search.cpan.org/search?mode=all&query=Template%3A%3AToolkit.


Attended by: Tony Bedford, Viv Noord, suresh rayapalli, Dheeraj Uppalapati, Anthony Shaper, Mallory van Achterberg (‎Stomme poes‎), Wendy Van Dijk (‎woolfy‎), Phil Quinn, Raul Matei (‎7le‎), Kyriakos Oikonomakos, Tom Bloor (‎TBSliver‎), narendra kumar lankothu,

Sponsors

Corporate

antibodyMX

Booking.com

Bytemark Hosting

Eligo Recruitment

Evozon Software

Exonetric

magnum Solutions

Motortrak

Nestoria

Net-A-Porter

Opus VL

Petamem

Shadowcat
      Systems Limited

Community

Enlightened Perl Organisation

Bar design at the bottom of the page