HTML-DWT-Simple

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

NAME
    HTML::DWT::Simple - DreamWeaver HTML Template Module (Simple)

SYNOPSIS
      use HTML::DWT::Simple;
  
      $template = new HTML::DWT::Simple(filename => "file.dwt");    
      %dataHash = (
                   doctitle => 'DWT Generated',
                   leftcont => 'some HTML content here'     
                   );  
      $template->param(%dataHash);
      $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
  new()

      new HTML::DWT("file.dwt");

      new HTML::DWT(
                    filename => "file.dwt",
                    associate => $q,
                   );

    Creates and returns a new HTML::DWT object based on the Dreamweaver
    template 'file.dwt' (can specify a relative or absolute path). The
    Second instance is recommended, although the first style is still
    supported for backwards compatability with versions of HTML::DWT before
    2.05.

    associate: The associate option allows the template to inherit parameter
    values from other objects. The object associated with the template must
    have a param() method which works like HTML::DWT::Simple's param(). Both
    CGI and HTML::Template fit this profile. To associate another object,
    create it and pass the reference scalar to HTML::DWT::Simple's new()
    method under the associate option (see above).

  param()

      $template->param();

      $template->param('doctitle');

      $template->param(
                      doctitle => '<title>DWT Generated</title>',
                      leftcont => 'Some HTML content here'
                      );

    Takes a hash of one or more key/value pairs, where each key is a named
    area of the template, and the associated value is the HTML content for
    that area. This method returns void (HTML substitiutions are stored
    within the object awaiting output()).

    If called with a single paramter--this parameter must be a valid field
    name--param() returns the value currently set for the field, or undef if
    no value has been set.

    If called with no parameters, param() returns a list of all field names.

    NOTE: All Dreamweaver templates store the HTML page's title in a field
    named 'doctitle'. HTML::DWT::Simple will accept a raw title (without
    <title> tags) and will add the appropriate tags if the content of the
    'doctitle' field should require them.

    This is a HTML::Template compatible method.

  output()

      $template->output();
  
      $template->output(print_to => \*STDOUT);



( run in 2.055 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )