Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 08388ac8

Von Sven Schöling vor etwa 14 Jahren hinzugefügt

  • ID 08388ac8eaff0dbecfe5aded36e8cf297466cd57
  • Vorgänger d4f9d559
  • Nachfolger ec409dd1

Template Caching

Unterschiede anzeigen:

SL/Form.pm
841 841
                                 'CACHE_SIZE'   => 0,
842 842
                                 'PLUGIN_BASE'  => 'SL::Template::Plugin',
843 843
                                 'INCLUDE_PATH' => '.:templates/webpages',
844
                                 'COMPILE_EXT'  => $main::template_compile_ext,
845
                                 'COMPILE_DIR'  => $main::template_compile_dir,
844 846
                               }) || die;
845 847

  
846 848
  map { $additional_params->{$_} ||= $self->{$_} } keys %{ $self };
847 849

  
848
  my $in = IO::File->new($file, 'r');
849

  
850
  if (!$in) {
851
    print STDERR "Error opening template file: $!";
852
    $main::lxdebug->leave_sub();
853
    return '';
854
  }
855

  
856
  my $input = join('', <$in>);
857
  $in->close();
858

  
859 850
  my $output;
860
  if (!$template->process(\$input, $additional_params, \$output)) {
851
  if (!$template->process($file, $additional_params, \$output)) {
861 852
    print STDERR $template->error();
862 853
  }
863 854

  
config/lx-erp.conf
13 13
# templates base directory
14 14
$templates = "templates";
15 15

  
16
# template toolkit caching options
17
$template_compile_ext = '.tcc';
18
$template_compile_dir = 'templates/cache';
19

  
16 20
# member file
17 21
$memberfile = "users/members";
18 22

  

Auch abrufbar als: Unified diff