<<

Bugzilla::Template

NAME

Bugzilla::Template - Wrapper around the Template Toolkit Template object

SYNOPSIS

  my $template = Bugzilla::Template->create;

  $template->put_header($title, $h1, $h2);
  $template->put_footer();

  my $format = $template->get_format("foo/bar",
                                     scalar($cgi->param('format')),
                                     scalar($cgi->param('ctype')));

DESCRIPTION

This is basically a wrapper so that the correct arguments get passed into the Template constructor.

It should not be used directly by scripts or modules - instead, use Bugzilla->instance->template to get an already created module.

SUBROUTINES

precompile_templates($output)

Description: Compiles all of Bugzilla's templates in every language. Used mostly by checksetup.pl.

Params: $output - true if you want the function to print out information about what it's doing.

Returns: nothing

METHODS

put_header($title, $h1, $h2)
 Description: Display the header of the page for non yet templatized .cgi files.

 Params:      $title - Page title.
              $h1    - Main page header.
              $h2    - Page subheader.

 Returns:     nothing
put_footer()
 Description: Display the footer of the page for non yet templatized .cgi files.

 Params:      none

 Returns:     nothing
get_format($file, $format, $ctype)
 Description: Construct a format object from URL parameters.

 Params:      $file   - Name of the template to display.
              $format - When the template exists under several formats
                        (e.g. table or graph), specify the one to choose.
              $ctype  - Content type, see Bugzilla::Constants::contenttypes.

 Returns:     A format object.

SEE ALSO

Bugzilla, Template

<<