|
Link Here
|
| 110 |
|
110 |
|
| 111 |
=head3 dbic_merge_pagination |
111 |
=head3 dbic_merge_pagination |
| 112 |
|
112 |
|
| 113 |
$filter = $c->dbic_merge_pagination({ |
113 |
$attributes = $c->dbic_merge_pagination({ |
| 114 |
filter => $filter, |
114 |
attributes => $attributes, |
| 115 |
params => { |
115 |
params => { |
| 116 |
page => $params->{_page}, |
116 |
page => $params->{_page}, |
| 117 |
per_page => $params->{_per_page} |
117 |
per_page => $params->{_per_page}, |
|
|
118 |
... |
| 118 |
} |
119 |
} |
| 119 |
}); |
120 |
}); |
| 120 |
|
121 |
|
| 121 |
Adds I<page> and I<rows> elements to the filter parameter. |
122 |
Adds I<page> and I<rows> elements to the I<attributes> parameter. |
| 122 |
|
123 |
|
| 123 |
=cut |
124 |
=cut |
| 124 |
|
125 |
|
| 125 |
$app->helper( |
126 |
$app->helper( |
| 126 |
'dbic_merge_pagination' => sub { |
127 |
'dbic_merge_pagination' => sub { |
| 127 |
my ( $c, $args ) = @_; |
128 |
my ( $c, $args ) = @_; |
| 128 |
my $filter = $args->{filter}; |
129 |
my $attributes = $args->{attributes}; |
| 129 |
|
130 |
|
| 130 |
$filter->{page} = $args->{params}->{_page}; |
131 |
$attributes->{page} = $args->{params}->{_page}; |
| 131 |
$filter->{rows} = $args->{params}->{_per_page}; |
132 |
$attributes->{rows} = $args->{params}->{_per_page}; |
| 132 |
|
133 |
|
| 133 |
return $filter; |
134 |
return $attributes; |
| 134 |
} |
135 |
} |
| 135 |
); |
136 |
); |
| 136 |
} |
137 |
} |