CGI-Application-Plugin-AnyTemplate

 view release on metacpan or  search on metacpan

lib/CGI/Application/Plugin/AnyTemplate/Driver/HTMLTemplateExpr.pm  view on Meta::CPAN


package CGI::Application::Plugin::AnyTemplate::Driver::HTMLTemplateExpr;

=head1 NAME

CGI::Application::Plugin::AnyTemplate::Driver::HTMLTemplateExpr - HTML::Template::Expr driver to AnyTemplate

=head1 DESCRIPTION

This is a driver for L<CGI::Application::Plugin::AnyTemplate>, which
provides the implementation details specific to rendering templates via
the L<HTML::Template::Expr> templating system.

All C<AnyTemplate> drivers are designed to be used the same way.  For
general usage instructions, see the documentation of
L<CGI::Application::Plugin::AnyTemplate>.

=head1 EMBEDDED COMPONENT SYNTAX (HTML::Template::Expr)

=head2 Syntax

The L<HTML::Template::Expr> syntax for embedding components is:

    <TMPL_VAR EXPR="CGIAPP_embed('some_run_mode', param1, param2, 'literal string3')">

This can be overridden by the following configuration variables:

    embed_tag_name       # default 'CGIAPP_embed'

For instance by setting the following value in your configuration file:

    embed_tag_name       '__ACME_render'

Then the embedded component tag will look like:

    <TMPL_VAR EXPR="__ACME_render('some_run_mode')">

The value of C<embed_tag_name> must consist of numbers, letters and
underscores (C<_>), and must not begin with a number.

=cut

use strict;
use Carp;

use CGI::Application::Plugin::AnyTemplate::ComponentHandler;

use CGI::Application::Plugin::AnyTemplate::Base;
use vars qw(@ISA);
@ISA = ('CGI::Application::Plugin::AnyTemplate::Base');

=head1 CONFIGURATION

The L<CGI::Application::Plugin::AnyTemplate::Driver::HTMLTemplateExpr> driver
accepts the following config parameters:

=over 4

=item embed_tag_name

The name of the tag used for embedding components.  Defaults to
C<CGIAPP_embed>.

=item template_extension

If C<auto_add_template_extension> is true, then
L<CGI::Application::Plugin::AnyTemplate> will append the value of
C<template_extension> to C<filename>.  By default
the C<template_extension> is C<.html>.

=item associate_query

B<This feature is now deprecated and will be removed in a future release.>

If this config parameter is true, then
L<CGI::Application::Plugin::AnyTemplate::Driver::HTMLTemplateExpr> will
copy all of the webapp's query params into the template using
L<HTML::Template::Expr>'s C<associate> mechanism:



( run in 0.962 second using v1.01-cache-2.11-cpan-71847e10f99 )