NAME

Top Close Open

Template::TT3::Class::Dialect - metaprogramming module for creating dialects

SYNOPSIS

Top Close Open
package TemplateX::Dialect::Example;

use Template::TT3::Class::Dialect
    version => 3.14,
    debug   => 0,
    scanner => 'My::Scanner::Module',
    tagset  => 'My::Tagset::Module';

DESCRIPTION

Top Close Open

This module implements a subclass of Badger::Class that is specialised for creating dialect modules.

USE OPTIONS

Top Close Open

The following options can be specified when the Template::TT3::Class::Dialect module is loaded in addition to those inherited from the Template::TT3::Class and Badger::Class base class modules.

scanner

Top Close Open

This option can be used to define either a scanner module that your dialect should use, a set of configuration options for the default scanner, or both.

# specifying a scanner module
use Template::TT3::Class::Dialect
    scanner => 'My::Scanner::Module';

# specifying scanner options
use Template::TT3::Class::Dialect
    scanner => { 
        # scanner configuration options go here
    };

# specifying scanner module and options
use Template::TT3::Class::Dialect
    scanner => [
        'My::Scanner::Module', 
        { 
            # scanner configuration options go here
        }
    ];

The option is a shortcut for setting the $SCANNER_MODULE and/or $SCANNER package variables which will have the same effect.

our $SCANNER_MODULE = 'My::Scanner:Module';
our $SCANNER = {
    # scanner configuration options go here
};

tagset

Top Close Open

This option can be used to define either a tagset module that your dialect should use, a set of configuration options for the default tagset, or both. It is similar to scanner but sets the $TAGSET_MODULE and/or $TAGSET package variables.

template

Top Close Open

This option can be used to define the template modules that your dialect should use. It should probably allow you to also define options, but for some reason it doesn't. TODO: I need to look into that...

METHODS

Top Close Open

This module implements the following methods in addition to those inherited from the Template::TT3::Class and Badger::Class base class modules.

scanner($config)

Top Close Open

Method used to define a scanner module and/or configuration. See the scanner option.

tagset($config)

Top Close Open

Method used to define a tagset module and/or configuration. See the tagset option.

template($module)

Top Close Open

Method used to define the template module.

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.

SEE ALSO.

Top Close Open

This module inherits methods from the Template::TT3::Class and Badger::Class base class modules.


http://tt3.template-toolkit.org/docs/Template/TT3/Class/Dialect.pm last modified 2009-12-22 19:11:17