Revision 11093bd5
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/Controller/Base.pm | ||
---|---|---|
4 | 4 |
|
5 | 5 |
use List::Util qw(first); |
6 | 6 |
|
7 |
# |
|
8 |
# public/helper functions |
|
9 |
# |
|
10 |
|
|
7 | 11 |
sub parse_html_template { |
8 | 12 |
my $self = shift; |
9 | 13 |
my $name = shift; |
... | ... | |
26 | 30 |
return "controller.pl?${query}"; |
27 | 31 |
} |
28 | 32 |
|
33 |
sub redirect_to { |
|
34 |
my $self = shift; |
|
35 |
my $url = $self->url_for(@_); |
|
36 |
|
|
37 |
print $::cgi->redirect($url); |
|
38 |
} |
|
39 |
|
|
40 |
# |
|
41 |
# private functions -- for use in Base only |
|
42 |
# |
|
43 |
|
|
29 | 44 |
sub _run_action { |
30 | 45 |
my $self = shift; |
31 | 46 |
my $action = "action_" . shift; |
... | ... | |
169 | 184 |
|
170 | 185 |
<a href="[% SELF.url_for(controller => 'Message', action => 'new', recipient_id => 42) %]">create new message</a> |
171 | 186 |
|
187 |
=item redirect_to %url_params |
|
188 |
|
|
189 |
Redirects the browser to a new URL by outputting a HTTP redirect |
|
190 |
header. The URL is generated by calling L</url_for> with |
|
191 |
C<%url_params>. |
|
192 |
|
|
172 | 193 |
=back |
173 | 194 |
|
174 | 195 |
=head2 PRIVATE FUNCTIONS |
Auch abrufbar als: Unified diff
Controller-Base: Methode für HTTP-Redirect implementiert