Revision ec3a4636
Von Sven Schöling vor etwa 11 Jahren hinzugefügt
SL/Template/Plugin/L.pm | ||
---|---|---|
465 | 465 |
my ($self, %params) = _hashify(1, @_); |
466 | 466 |
|
467 | 467 |
my $controller = $self->{CONTEXT}->stash->get('SELF'); |
468 |
my $paginate_spec = $controller->get_paginate_spec; |
|
469 |
my %paginate_params = $controller->get_current_paginate_params; |
|
468 |
my $pager = $params{models}->paginated; |
|
469 |
# my $paginate_spec = $controller->get_paginate_spec; |
|
470 |
|
|
471 |
my %paginate_params = $params{models}->get_paginate_args; |
|
470 | 472 |
|
471 | 473 |
my %template_params = ( |
472 | 474 |
pages => \%paginate_params, |
473 | 475 |
url_maker => sub { |
474 | 476 |
my %url_params = _hashify(0, @_); |
475 |
$url_params{ $paginate_spec->{FORM_PARAMS}->[0] } = delete $url_params{page};
|
|
476 |
$url_params{ $paginate_spec->{FORM_PARAMS}->[1] } = delete $url_params{per_page} if exists $url_params{per_page};
|
|
477 |
$url_params{ $pager->form_params->[0] } = delete $url_params{page};
|
|
478 |
$url_params{ $pager->form_params->[1] } = delete $url_params{per_page} if exists $url_params{per_page};
|
|
477 | 479 |
|
478 |
return $controller->get_callback(%url_params);
|
|
480 |
return $params{models}->get_callback(%url_params);
|
|
479 | 481 |
}, |
480 | 482 |
%params, |
481 | 483 |
); |
Auch abrufbar als: Unified diff
Erste Version GetModels rewrite
known bugs:
disable pagination funktioniert nicht
compiletime optimizations werden noch nicht benutzt
doku fehlt