Revision 7e0814bb
Von Moritz Bunkus vor etwa 11 Jahren hinzugefügt
SL/Template.pm | ||
---|---|---|
my %params = @_;
|
||
my $package = "SL::Template::" . $params{type};
|
||
|
||
$package->new($params{file_name}, $params{form}, $params{myconfig} || \%::myconfig, $params{userspath} || $::lx_office_conf{paths}->{userspath});
|
||
$package->new(
|
||
%params,
|
||
source => $params{file_name},
|
||
form => $params{form},
|
||
myconfig => $params{myconfig} || \%::myconfig,
|
||
userspath => $params{userspath} || $::lx_office_conf{paths}->{userspath},
|
||
);
|
||
}
|
||
|
||
sub available_templates {
|
SL/Template/Simple.pm | ||
---|---|---|
}
|
||
|
||
sub _init {
|
||
my $self = shift;
|
||
my ($self, %params) = @_;
|
||
|
||
$self->{source} = shift;
|
||
$self->{form} = shift;
|
||
$self->{myconfig} = shift;
|
||
$self->{userspath} = shift;
|
||
$self->{$_} = $params{$_} for keys %params;
|
||
|
||
$self->{error} = undef;
|
||
$self->{quot_re} = '"';
|
Auch abrufbar als: Unified diff
Refactoring: SL::Template: Parameterübergabe als Hash, nicht positionsabhängig