NAME

CGI::Application::Plugin::AnyTemplate::Dispatcher - Dispatch to run modes from within a template

DESCRIPTION

This is a little helper module used by the CGI::Application::Plugin::AnyTemplate to handle the actual dispatch of embedded components to the proper run modes.

You shouldn't need to use this module directly unless you are adding support for a new template system.

For information on component dispatch see the docs of CGI::Application::Plugin::AnyTemplate.

METHODS

new

Creates a new CGI::Application::Plugin::AnyTemplate::Dispatcher object.

my $dispatcher = CGI::Application::Plugin::AnyTemplate::Dispatcher->new(
    webapp              => $webapp,
    containing_template => $template,
);

The webapp parameter should be a reference to a CGI::Application object.

The containing_template parameter should be a reference to the template object in which this component is embedded.

dispatch

Runs the specified runmode of the webapp object. Returns the results of this call.

Parameters passed to dispatch should be passed on to the run mode.

If the results are a scalar reference, then the return value is dereferenced before returning. This is the safest way of dispatching, but it involves returning potentially very large strings from subroutines.

dispatch_direct

Runs the specified runmode of the webapp object. Returns the results of this call.

Parameters passed to dispatch should be passed on to the run mode.

Even if the result of this call is a scalar reference, the result is NOT dereferenced before returning it.

If you call this method instead of dispatch, you should be careful to deal with the possibility that your results are a reference to a string and not the string itself.

AUTHOR

Michael Graham, <mag-perl@occamstoothbrush.com>

COPYRIGHT & LICENSE

Copyright 2005 Michael Graham, All Rights Reserved.

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