In anticipation of creating some plugins, I was reviewing the docs at 
http://www.template-toolkit.org/docs/plain/Modules/Template/Plugin.html.

It is not perfectly clear where I put the code to identify PLUGIN_BASE - should my 
package look like this:


    package MyOrg::Template::Plugin::MyPlugin;
    use base qw( Template::Plugin );
    use Template::Plugin;
    use MyModule;
    use Template;

    sub new {
        my $class   = shift;
        my $context = shift;
        bless {
            ...
        }, $class;
    }

    my $template = Template->new({
                PLUGIN_BASE => 'MyOrg::Template::Plugin',
                });

....

where $template is global to the package? I grepped the code in the default plugins 
but didn't find any good examples, and I didn't find any examples on a google for 
"PLUGIN_BASE =>" either.

thanks for you help!

Barry Caplan
www.i18n.com








At 08:22 AM 12/5/2002 -0500, darren chamberlain wrote:
>* Eric Sammer <[EMAIL PROTECTED]> [2002-12-04 23:43]:
>> All:
>
>Hello!
>
>[--  snip mod_perl talk --]
>
>> All of this brings up an extremely stupid problem - the trailing slash 
>> in the url. Due to the specification of the Location directives and the 
>> (potential) use of path_info() for self contained sections (multipage 
>> forms, sections that do use path_info() for dispatch style design, 
>> etc.), I'm forced to specify my "modules" as www.site.com/login/
>
>If you are dealing with files being handled by a handler, you can do
>something like:
>
>  use Apache::Constants qw(:types);
>
>  sub handler {
>      my $r = shift;
>      return DECLINED if $r->content_type eq DIR_MAGIC_TYPE;
>
>to decline handling directories in your handler.  (You might need to
>tweak that a little).  This means that mod_dir will get a crack at it,
>and rewrite it to index.html or whatever, and then let your handler
>handle with rewritten request.
>
>(darren)
> 
>-- 
>The first rule of magic is simple.  Don't waste your time waving your
>hands and hoping when a rock or a club will do.
>    -- McCloctnik the Lucid
>
>_______________________________________________
>templates mailing list
>[EMAIL PROTECTED]
>http://lists.ourshack.com/mailman/listinfo/templates 


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.ourshack.com/mailman/listinfo/templates

Reply via email to