Revision aa85133a
Von Sven Schöling vor fast 7 Jahren hinzugefügt
SL/Controller/Base.pm | ||
---|---|---|
29 | 29 |
my %params = ref($_[0]) eq 'HASH' ? %{ $_[0] } : @_; |
30 | 30 |
my $controller = delete($params{controller}) || $self->controller_name; |
31 | 31 |
my $action = $params{action} || 'dispatch'; |
32 |
my $fragment = delete $params{hash} // delete $params{fragment} // ''; |
|
32 | 33 |
|
33 | 34 |
my $script; |
34 | 35 |
if ($controller =~ m/\.pl$/) { |
... | ... | |
41 | 42 |
|
42 | 43 |
my $query = join '&', map { uri_encode($_->[0]) . '=' . uri_encode($_->[1]) } @{ flatten(\%params) }; |
43 | 44 |
|
44 |
return "${script}?${query}"; |
|
45 |
return "${script}?${query}" . ($fragment ? "#$fragment" : '');
|
|
45 | 46 |
} |
46 | 47 |
|
47 | 48 |
sub redirect_to { |
Auch abrufbar als: Unified diff
Controller::Base: url_for unterstützt jetzt URI fragments.