| TRD-Velocity documentation | view source | Contained in the TRD-Velocity distribution. |
TRD::Velocity - Template engine
Version 0.0.8
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;
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.
new Constructor.
my $velo = new TRD::Velocity;
set parameter.
$velo->set( 'itemname', 'Apple' );
set Template file.
$velo->setTemplateFile( './template/soldmail.txt' );
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 template to parameters.
my $doc = $velo->marge();
private function.
private function.
private function.
private function.
private function.
Dump parameters.
Takuya Ichikawa, <trd.ichi at gmail.com>
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.
You can find documentation for this module with the perldoc command.
perldoc TRD::Velocity
You can also look for information at:
Copyright 2010 Takuya Ichikawa, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| TRD-Velocity documentation | view source | Contained in the TRD-Velocity distribution. |