X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/2b7f7e75b4cfe8e111775970a4524ab48ec898bb..1cff7d8034b00f4fd365a716596b54b798f035d7:/SL/Controller/Base.pm diff --git a/SL/Controller/Base.pm b/SL/Controller/Base.pm index b97f3c509..d10ba805c 100644 --- a/SL/Controller/Base.pm +++ b/SL/Controller/Base.pm @@ -29,6 +29,7 @@ sub url_for { my %params = ref($_[0]) eq 'HASH' ? %{ $_[0] } : @_; my $controller = delete($params{controller}) || $self->controller_name; my $action = $params{action} || 'dispatch'; + my $fragment = delete $params{hash} // delete $params{fragment} // ''; my $script; if ($controller =~ m/\.pl$/) { @@ -41,7 +42,7 @@ sub url_for { my $query = join '&', map { uri_encode($_->[0]) . '=' . uri_encode($_->[1]) } @{ flatten(\%params) }; - return "${script}?${query}"; + return "${script}?${query}" . ($fragment ? "#$fragment" : ''); } sub redirect_to { @@ -166,6 +167,8 @@ sub send_file { } else { $::locale->with_raw_io(\*STDOUT, sub { print $$file_name_or_content }); } + + return 1; } sub presenter {