HTML-DWT
view release on metacpan or search on metacpan
package HTML::DWT;
#############################################################
# Version 2.08
#
# Copyright (c) 2002 by S.D. Campbell <whytwolf@spots.ab.ca>
#
# Created 03 March 2000; Revised 04 March 2002 by SDC
#
# A perl module designed to parse a simple HTML template file
# generated by Macromedia Dreamweaver and replace fields in the
# template with values from a CGI script.
#
#############################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
$template = new HTML::DWT(filename => "file.dwt");
$template->param(
doctitle => '<title>DWT Generated</title>',
leftcont => 'Some HTML content here'
);
$html = $template->output();
=head1 DESCRIPTION
A perl module designed to parse a simple HTML template file
generated by Macromedia Dreamweaver and replace fields in the
template with values from a CGI script.
=head1 METHODS
=head2 Options
use HTML::DWT qw(:Template);
Using the Template option allows for built in support in HTML::DWT
for the HTML::Template invocation syntax (param(), output() etc.) See
<?xml version="1.0"?>
<templateItems template="/Templates/temp.dwt">
<item name="centercont"><![CDATA[Testing]]></item>
<item name="doctitle"><![CDATA[<title>testing</title>]]></item>
<item name="leftcont"><![CDATA[Testing]]></item>
<item name="rightcont"><![CDATA[Testing]]></item>
</templateItems>
These documents can be automaticly generated both by HTML::DWT based
on template data using export(), or by Macromedia Dreamweaver.
=head2 fill()
$template->fill(\%dataHash);
$template->fillTemplate(\%dataHash);
Takes a hash reference where the keys are the named areas of the
template and the associated values are HTML content for those
areas. This method returns a complete HTML document, which can
$template = new HTML::DWT(filename => "file.dwt");
$template->param(
doctitle => '<title>DWT Generated</title>',
leftcont => 'Some HTML content here'
);
$html = $template->output();
DESCRIPTION
A perl module designed to parse a simple HTML template file generated by
Macromedia Dreamweaver and replace fields in the template with values
from a CGI script.
METHODS
Options
use HTML::DWT qw(:Template);
Using the Template option allows for built in support in HTML::DWT for
the HTML::Template invocation syntax (param(), output() etc.) See
HTML::Template for more details. It is best to require a version of 2.05
<?xml version="1.0"?>
<templateItems template="/Templates/temp.dwt">
<item name="centercont"><![CDATA[Testing]]></item>
<item name="doctitle"><![CDATA[<title>testing</title>]]></item>
<item name="leftcont"><![CDATA[Testing]]></item>
<item name="rightcont"><![CDATA[Testing]]></item>
</templateItems>
These documents can be automaticly generated both by HTML::DWT based on
template data using export(), or by Macromedia Dreamweaver.
fill()
$template->fill(\%dataHash);
$template->fillTemplate(\%dataHash);
Takes a hash reference where the keys are the named areas of the
template and the associated values are HTML content for those areas.
This method returns a complete HTML document, which can then be sent to
( run in 0.634 second using v1.01-cache-2.11-cpan-49f99fa48dc )