> Subclass Template::Service::Apache and provide your own header() method.
> There's not a lot to it, other than sending the content type and some 
> extra headers.
> 
> Then use the following directive in the httpd.conf to invoke your new 
> service module:
> 
>    TT2ServiceModule  Your::Service::Module
> 
> Alternately, if you're feeling adventurous, you could figure out how
> to add the TT2ContentType configuration directive and then hack on 
> the regular Template::Service::Apache::header() method to make this a
> configurable option.
> 
> HTH
> A
Ooops posting this back to the list:
Thanx i figured that out just before your reply. 
I just made a new  Template::Service::Apache module with the following 
headers() sub: 

sub headers {
    my ($self, $r, $template, $content) = @_;
    my $headers = $self->{ SERVICE_HEADERS };
    my $all = $headers->{ all };
    my $ct = $r->dir_config("TT2CustomHeader") ?
        $r->dir_config("TT2CustomHeader") : "text/html";
    $r->content_type($ct);
    $r->headers_out->add('Last-Modified'  =>
ht_time($template->modtime()))
        if $all or $headers->{ modified } and $template;
    $r->headers_out->add('Content-Length' => length $$content)
        if $all or $headers->{ length };
    $r->headers_out->add('E-tag' => sprintf q{"%s"}, md5_hex($$content))
        if $all or $headers->{ etag };
    $r->send_http_header;
}


And i'm just adding a: 
PerlSetVar TT2CustomHeader 
to my configuration. 
Not as clean as adding a configuration option but I don't feel THAT
adventurous today ;-). 

Thak you very much for the swift reply, 

Loic. 
> 
> 
> _______________________________________________
> templates mailing list
> [EMAIL PROTECTED]
> http://lists.template-toolkit.org/mailman/listinfo/templates
-- 
Lo�c.


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to