NAME
    CGI::Application::Plugin::HTDot - Enable "magic dot" notation in
    CGI::Application-derived applications that use HTML::Template for their
    templating mechanism.

VERSION
    Version 0.02

SYNOPSIS
        # In your CGI::Application-derived base class. . . 
        use base ("CGI::Application::Plugin::HTDot", "CGI::Application");

        # Later, in a run mode far, far away. . . 
        sub view
        {
            my $self = shift;
            my $username = $self->query->param("user");
            my $user     = My::Users->retrieve($username);

            my $tmpl_view = $self->load_tmpl( "view_user.tmpl" );

            # The magic happens here!  Pass our Class::DBI object
            # to the template and display it
            $tmpl_view->param( user => $user );

            return $tmpl_view->output;
        }

DESCRIPTION
    Imagine this: you've written a lot of code based upon CGI::Application,
    and also with HTML::Template because the two have always had such a high
    level of integration. You reach a situation (many times, perhaps) where
    you could really use the power and convenience of being able to pass
    objects to your templates and call methods of those objects from within
    your template (ala Template Toolkit), but your development schedule
    doesn't give you the time to learn (much less migrate to!) Template
    Toolkit or AnyTemplate. Well, you need fret no more!
    "CGI::Application::Plugin::HTDot" helps you bring the power of the magic
    dot to your HTML::Template-based templates from within your
    CGI::Application-derived webapps.

    CGI::Application::Plugin::HTDot provides the glue between
    CGI::Application, HTML::Template::Pluggable and
    HTML::Template::Plugin::Dot. It overrides the "load_tmpl()" method
    provided with CGI::Application and replaces it with one that turns on
    the magic dot in HTML::Template. The "load_tmpl()" method provided here
    is 100% compatible with the one found in a stock CGI::Application app,
    so using this plugin does not require refactoring of any code. You can
    use the magic dot in your application and templates going forward, and
    refactor older code to use it as your schedule permits.

    When you have lots of apps and lots of templates, and no means to switch
    to Template Toolkit, this will make your life infinitely easier.

    For more information about the magic dot, see
    HTML::Template::Plugin::Dot.

FUNCTIONS
  load_tmpl()
    For the most part, this is the exact "load_tmpl()" method from
    CGI::Application, except it uses HTML::Template::Pluggable and
    HTML::Template::Plugin::Dot instead of HTML::Template.

    See the CGI::Application reference for more detailed information on what
    parameters can be passed to "load_tmpl()".

  Extending load_tmpl()
    There are times when the basic "load_tmpl()" functionality just isn't
    enough. Many HTML::Template developers set "die_on_bad_params" to 0 on
    all of their templates. The easiest way to do this is by replacing or
    extending the functionality of CGI::Application's "load_tmpl()" method.
    This is still possible using the plugin.

    The following code snippet illustrates one possible way of achieving
    this:

      sub load_tmpl
      {
          my ($self, $tmpl_file, @extra_params) = @_;

          push @extra_params, "die_on_bad_params", "0";
          push @extra_params, "cache",             "1";

          return $self->SUPER::load_tmpl($tmpl_file, @extra_params);
      }

AUTHOR
    Jason A. Crome, "<cromedome@cpan.org>"

BUGS
    Please report any bugs or feature requests to
    "bug-cgi-application-plugin-htdot@rt.cpan.org", or through the web
    interface at
    <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-H
    TDot>. I will be notified, and then you'll automatically be notified of
    progress on your bug as I make changes.

ACKNOWLEDGEMENTS
    Credit needs to be given to Jesse Erlbaum and Mark Stosberg for the
    original "load_tmpl()" method that this is based on. Special thanks also
    to Rhesa Rozendaal and Mark Stosberg for their work on enabling the
    magic dot in HTML::Template, and to the usual crowd in #cgiapp on
    irc.perl.org for making this all worthwhile for me :)

SEE ALSO
    CGI::Application, HTML::Template, HTML::Template::Pluggable,
    HTML::Template::Plugin::Dot.

COPYRIGHT & LICENSE
    Copyright 2005 Jason A. Crome, all rights reserved.

    This program is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

