NAME

Top Close Open

Template::TT3::Developer::Compatibility - Backward compatibility for TT developers

INTRODUCTION

Top Close Open

This is a rough draft of the developer documentation that will discuss backwards compatibility between TT3 and TT2.

TODO

Top Close Open

As Bob Dylan said: "Eveything's broken". Sorry, but everything inside TT3 is different to how it was in TT2.

Template::Service

Top Close Open

The monolithic service module from TT2 has been replaced by a number of small, simple service modules that each perform one task and one task only (e.g. add a header, add a footer, etc). These can be combined in all sorts of interesting ways to create your own custom template processing service pipelines. Or you can just use the default service pipeline which allows you to add headers, footers, wrappers, and all the other things that TT2 allowed you to add.

See Template::TT3::Services for an introduction to services. Please be aware that the service pipeline code is quite new and subject to change.

Template::Context

Top Close Open

Performs a similar role in TT3 as its counterpart in TT2, but it has an all-new API and implementation.

Template::Stash

Top Close Open

No longer exists. The high-level "get/set this variable" functionality is now in Template::TT3::Context . The dotop mechanism is implemented in Template::TT3::Variable and subclasses. The virtual methods are implemented in Template::TT3::Type and subclasses.

Please note that the Template::TT3::Variables module was used during development (and is still being used at the time of writing) but it's due for deprecation (although I may change my mind). Don't get too attached to it

Template::Provider

Top Close Open

This has been split into a whole bunch of modules. Template::TT3::Templates is the master template manager. Template::TT3::Cache handles the in-memory cache and Template::TT3::Store handles to on-disk storage of compiled templates. Both are API compatible with Cache::Cache modules making it easy for you to drop in your own replacements for these.

The Template::TT3::Provider module is a base class for a new set of low-level template providers that only have to worry about loading a template from a file, database, or some other source and returning a hash array containing some information about the template. This makes them much simpler that the old TT2 provider module.

Template::TT3::Provider::File is the main provider that loads files from the filesystem. Template::TT3::Provider::Cwd is a special case filesystem provider that is engaged when no template_path is specified. This looks in the current working directory for templates that are specified with a relative path.

Template::Document

Top Close Open

Replaced with Template::TT3::Template , but it's much changed.

TODO

Top Close Open

The above list is incomplete. It's just the first few things I could think of off the top of my head. More work todo here.

AUTHOR

Top Close Open

Andy Wardley http://wardley.org/

COPYRIGHT

Top Close Open

Copyright (C) 1996-2009 Andy Wardley. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


http://tt3.template-toolkit.org/docs/Template/TT3/Developer/Compatibility.pod last modified 2009-12-13 19:55:03