Revision 1d9947e0
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/Controller/Base.pm | ||
---|---|---|
14 | 14 |
sub url_for { |
15 | 15 |
my $self = shift; |
16 | 16 |
|
17 |
return $_[0] if scalar(@_) == 1;
|
|
17 |
return $_[0] if (scalar(@_) == 1) && !ref($_[0]);
|
|
18 | 18 |
|
19 |
my %params = @_; |
|
19 |
my %params = ref($_[0]) eq 'HASH' ? %{ $_[0] } : @_;
|
|
20 | 20 |
my $controller = delete($params{controller}) || $self->_controller_name; |
21 | 21 |
my $action = delete($params{action}) || 'dispatch'; |
22 | 22 |
$params{action} = "${controller}/${action}"; |
Auch abrufbar als: Unified diff
url_for: Template übergibt Hash-Parameter als Hash-Referenz