Nik Ogura > CGI-Lazy-0.06 > CGI::Lazy::Template

Download:
Lazy/CGI-Lazy-0.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: CGI-Lazy-1.05

LEGAL ^

#===========================================================================

Copyright (C) 2008 by Nik Ogura. All rights reserved.

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

Bug reports and comments to nik.ogura@gmail.com.

#===========================================================================

NAME ^

CGI::Lazy::Template

SYNOPSIS ^

        use CGI::Lazy;

        my $q = CGI::Lazy->new('/path/to/config/file');

        print $q->template('topbanner1.tmpl')->process({ mainTitle => 'Main Title', secondaryTitle => 'Secondary Title', versionTitle => 'version 0.1', messageTitle => 'blah blah blah', });

DESCRIPTION ^

CGI::Lazy::Template is pretty much just a wrapper to HTML::Template. It takes a template name as it's single argument, and has a single useful method: process, which takes a hashref of variables to shuffle together with the template for subsequent printing to the browser.

METHODS ^

config

Returns CGI::Lazy::Config object

q

Returns CGI::Lazy object.

new (q, template)

Constructor.

q

CGI::Lazy object

template

Template file name. File must be in the template directory as specified by the config file.

process (vars)

Shuffles values contained in vars together with template for output.

vars

hashref of variables expected by template