Changeset 39

Show
Ignore:
Timestamp:
02/06/06 18:12:08
Author:
miyagawa
Message:

split out Template functionality into Plagger::Template

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger.pm

    r37 r39  
    1616use Plagger::Feed; 
    1717use Plagger::Subscription; 
     18use Plagger::Template; 
    1819use Plagger::Update; 
    19  
    20 use Template; 
    21 use Template::Provider::Encoding 0.04; 
    22 use Template::Stash::ForceUTF8; 
    23  
    24 our $TT; 
    2520 
    2621sub context { undef } 
     
    139134sub template { 
    140135    my $self = shift; 
    141     unless ($TT) { 
    142         my $path = $self->conf->{template_path} || 'templates'; 
    143         my $paths = [ $path, "$path/plugins" ]; 
    144         $TT = Template->new({ 
    145             INCLUDE_PATH => $paths, 
    146             LOAD_TEMPLATES => [ 
    147                 Template::Provider::Encoding->new({ INCLUDE_PATH => $paths }), 
    148             ], 
    149             STASH => Template::Stash::ForceUTF8->new, 
    150         }); 
    151     } 
    152     $TT; 
     136    $self->{template} ||= Plagger::Template->new($self); 
    153137} 
    154138