The Template::Context docs say that you can use a custom
Template::Context (or subclass) object in either of two ways:

(1) Create the context object and pass it in to the Template->new()
call:

   my $context  = OpenInteract::Template::Context->new();
   my $template = Template->new( CONTEXT => $context );

(2) Set the $Template::Config::CONTEXT variable to your context class
name:

   $Template::Config::CONTEXT = 'OpenInteract::Template::Context';
   my $template = Template->new();

Both work fine initially, but if I add the argument:

   PLUGINS => { OI => 'OpenInteract::Template::Plugin' },

to Template->new() and try to execute the following:

   my $oi_plugin = $template->context->plugin( 'OI' );    

Context option (2) is fine, but context option (1) gives me:

   'plugin error - OI: plugin not found'

Is there a difference I'm missing between the two?

Thanks,

Chris

PS - The reason for the custom context is because I use the
'blah::bloo' naming scheme for something else besides specifying a
provider to handle a template. (See Template::Context, lines 103 -
119.) It would be nifty if I could override this via configuration and
not even need a custom context :-)

-- 
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.


Reply via email to