Revision dd291d00
Von Sven Schöling vor etwa 13 Jahren hinzugefügt
SL/Controller/Base.pm | ||
---|---|---|
45 | 45 |
if ($options->{inline}) { |
46 | 46 |
$source = \$template; |
47 | 47 |
|
48 |
} elsif($options->{raw}) { |
|
49 |
$source = $template; |
|
50 |
|
|
48 | 51 |
} else { |
49 | 52 |
$source = "templates/webpages/${template}." . $options->{type}; |
50 | 53 |
croak "Template file ${source} not found" unless -f $source; |
... | ... | |
77 | 80 |
); |
78 | 81 |
|
79 | 82 |
my $output; |
80 |
my $parser = $self->_template_obj; |
|
81 |
$parser->process($source, \%params, \$output) || croak $parser->error; |
|
83 |
if (!$options->{raw}) { |
|
84 |
my $parser = $self->_template_obj; |
|
85 |
$parser->process($source, \%params, \$output) || croak $parser->error; |
|
86 |
} else { |
|
87 |
$output = $$source; |
|
88 |
} |
|
82 | 89 |
|
83 | 90 |
print $output unless $options->{inline} || $options->{no_output}; |
84 | 91 |
|
... | ... | |
322 | 329 |
will not be sent to the browser. Instead it is only returned to the |
323 | 330 |
caller. |
324 | 331 |
|
332 |
If C<< $options->{raw}>> is trueish, the function will treat the input as |
|
333 |
already parsed, and will not filter the input through Template. Unlike |
|
334 |
C<inline>, the input is taked as a reference. |
|
335 |
|
|
325 | 336 |
If C<< $options->{inline} >> is falsish then C<$template> is |
326 | 337 |
interpreted as the name of a template file. It is prefixed with |
327 | 338 |
"templates/webpages/" and postfixed with a file extension based on |
Auch abrufbar als: Unified diff
raw option für Controller Base