Chronicle::Template - Base class for Chronicle's template abstractions
This class should be used as a base class for Template plugins and provides a few utility methods for writing those. For users of the template plugins, it also provides the factory method create that takes care of loading and instantiating the required subclass.
The constructor takes a file name as a mandatory agument and a number of options as key-value pairs. The following options are currently defined:
theme_dir
theme
This module is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or
b) the Perl "Artistic License".
Matthias Bethke
Constructor.
This factory method takes the template text or file name as the only mandatory parameter and returns an instance of a Chronicle::Template subclass. A number of optional parameters may follow as key-value pairs. All of these options are passed to the subclass' constructor except for type. type specifies the desired subclass; default is "HTMLTemplate" for compatibility with the old hardcoded templates.
type
The following values are currently valid for type:
Add a parameter that can be used in template expansion later. Takes a key and a value to add.
This method takes no parameters and returns the final rendering result from applying all arguments set by param to the template.
Construct a path to a theme file from a filename passed in and the theme_dir and theme specified at construction time. Returns undef if the file does not exist or is not readable.
undef
Construct a path to the theme dir and check that it exists. Returns the diretory on success, undef otherwise.
To install App::Chronicle, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Chronicle
CPAN shell
perl -MCPAN -e shell install App::Chronicle
For more information on module installation, please visit the detailed CPAN module installation guide.