TRD::Velocity - Template engine


TRD-Velocity documentation  | view source Contained in the TRD-Velocity distribution.

Index


NAME

Top

TRD::Velocity - Template engine

VERSION

Top

Version 0.0.8

SYNOPSIS

Top

    use TRD::Velocity;

    $velo = new TRD::Velocity;
    $velo->setTemplateFile( 'foo.html' );
    $velo->set( 'name', 'value' );
    $html_stmt = $velo->marge();
    $ct = length( $html_stmt );
    print "Content-Type: text/html\n";
    print "Content-Length: ${ct}\n";
    print "\n";
    print $html_stmt;

EXPORT

Top

A list of functions that can be exported. You can delete this section if you don't export anything, such as for a purely object-oriented module.

FUNCTIONS

Top

new

    new Constructor.

    my $velo = new TRD::Velocity;

set( <name>, <value> )

    set parameter.

    $velo->set( 'itemname', 'Apple' );

setTemplateFile( <TemplateFileName> )

    set Template file.

    $velo->setTemplateFile( './template/soldmail.txt' );

setTemplateData( <TemplateData> )

    set Template data.

    my $template =<<EOT;
    Sender: ${sender}
    Email: ${email}
    EOT
    $velo->setTemplateData( $template );
=cut
#======================================================================
sub setTemplateData {
	my $self = shift;
	my $templateData = shift;

	$self->{templateFile} = undef;

	$self->{templateData} = $templateData;
}

marge

    Marge template to parameters.

    my $doc = $velo->marge();

tag_handler

    private function.

if_sub

    private function.

foreach_sub

    private function.

get_end

    private function.

marge_val

    private function.

dump

   Dump parameters.

AUTHOR

Top

Takuya Ichikawa, <trd.ichi at gmail.com>

BUGS

Top

Please report any bugs or feature requests to bug-trd-velocity at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=TRD-Velocity. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc TRD::Velocity




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=TRD-Velocity

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/TRD-Velocity

* CPAN Ratings

http://cpanratings.perl.org/d/TRD-Velocity

* Search CPAN

http://search.cpan.org/dist/TRD-Velocity

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


TRD-Velocity documentation  | view source Contained in the TRD-Velocity distribution.