Revision abd4a0b0
Von Sven Schöling vor fast 13 Jahren hinzugefügt
SL/Controller/Base.pm | ||
---|---|---|
30 | 30 |
my $self = shift; |
31 | 31 |
my $url = $self->url_for(@_); |
32 | 32 |
|
33 |
if ($self->delay_flash_on_redirect) { |
|
34 |
require SL::Helper::Flash; |
|
35 |
SL::Helper::Flash::delay_flash(); |
|
36 |
} |
|
37 |
|
|
33 | 38 |
print $::request->{cgi}->redirect($url); |
34 | 39 |
} |
35 | 40 |
|
... | ... | |
152 | 157 |
} |
153 | 158 |
} |
154 | 159 |
|
160 |
# |
|
161 |
# behaviour. override these |
|
162 |
# |
|
163 |
|
|
164 |
sub delay_flash_on_redirect { |
|
165 |
0; |
|
166 |
} |
|
167 |
|
|
155 | 168 |
# |
156 | 169 |
# private functions -- for use in Base only |
157 | 170 |
# |
... | ... | |
482 | 495 |
|
483 | 496 |
The hook's return values are discarded. |
484 | 497 |
|
498 |
=item delay_flash_on_redirect |
|
499 |
|
|
500 |
May be overridden by a controller. If this method returns true, redirect_to |
|
501 |
will delay all flash messages for the current request. Defaults to false for |
|
502 |
compatibility reasons. |
|
503 |
|
|
485 | 504 |
=back |
486 | 505 |
|
487 | 506 |
=head2 PRIVATE FUNCTIONS |
Auch abrufbar als: Unified diff
delay_flash_on_redirect Magie im Basecontroller.
Wenn von einem Controller explizit überladen, wird der normale Föash vor einem
redirect_to automatisch upgegradet in ein flash_later.
Conflicts: