NAME

Apache::PageKit::View - Bridge between Apache::PageKit and HTML::Template

SYNOPSIS

This class is a wrapper class to HTML::Template. It simplifies the calls to output a new template, stores the parameters to be used in a template, and fills in CGI forms using HTML::FillInForm and resolves <PKIT_*> tags.

METHODS

The following methods are available to the user as Apache::PageKit::View API.

new
my $view = new Apache::PageKit::View;

Constructor for new object.

param

This is similar to the HTML::Template method. It is used to set <MODEL_*> template variables.

$view->param(USERNAME => "John Doe");

Sets the parameter USERNAME to "John Doe". That is <MODEL_VAR NAME="USERNAME"> will be replaced with "John Doe".

It can also be used to set multiple parameters at once:

$view->param(firstname => $firstname,
             lastname => $lastname);
content_param

Similar to param but accesses and sets content variables associated with the <CONTENT_VAR> and <CONTENT_LOOP> tags.

prepare_component
$view->prepare_component(34);

Calles the code for the component with id 34 and fills in the component template.

prepare_output

Resolves <PKIT_*> tags and fills in HTML forms using HTML::FillInForm.

output_ref

Returns a reference to the output of the parsed template.

SEE ALSO

Apache::PageKit, HTML::FillInForm, HTML::Template

AUTHOR

T.J. Mather (tjmather@anidea.com)

COPYRIGHT

Copyright (c) 2000, AnIdea Corporation. All rights Reserved. PageKit is a trademark of AnIdea Corporation.

LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Ricoh Source Code Public License for more details.

You can redistribute this module and/or modify it only under the terms of the Ricoh Source Code Public License.

You should have received a copy of the Ricoh Source Code Public License along with this program; if not, obtain one at http://www.pagekit.org/license