]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/Base.pm
url_for: Template übergibt Hash-Parameter als Hash-Referenz
[mfinanz.git] / SL / Controller / Base.pm
index 06fd7fbdd753bc78ae9921f9410343f69fe3090b..112a7bd8a0cf68ac2b3baa9d5419148530093916 100644 (file)
@@ -14,12 +14,12 @@ sub parse_html_template {
 sub url_for {
   my $self = shift;
 
-  return $_[0] if scalar(@_) == 1;
+  return $_[0] if (scalar(@_) == 1) && !ref($_[0]);
 
-  my %params      = @_;
+  my %params      = ref($_[0]) eq 'HASH' ? %{ $_[0] } : @_;
   my $controller  = delete($params{controller}) || $self->_controller_name;
   my $action      = delete($params{action})     || 'dispatch';
-  $params{action} = "${controller}::${action}";
+  $params{action} = "${controller}/${action}";
   my $query       = join('&', map { $::form->escape($_) . '=' . $::form->escape($params{$_}) } keys %params);
 
   return "controller.pl?${query}";