File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,60 @@ class Book
196
196
}
197
197
` ` `
198
198
199
+ # # Changing Maximum items per page
200
+
201
+ # ## Globally
202
+
203
+ The number of maximum items per page can be configured for all resources :
204
+
205
+ ` ` ` yaml
206
+ # app/config/config.yml
207
+ api_platform:
208
+ collection:
209
+ pagination:
210
+ maximum_items_per_page: 50
211
+ ` ` `
212
+
213
+ # ## For a Specific Resource
214
+
215
+ ` ` ` php
216
+ <?php
217
+ // src/AppBundle/Entity/Book.php
218
+
219
+ use ApiPlatform\C ore\A nnotation\A piResource;
220
+
221
+ /**
222
+ * @ApiResource(
223
+ * attributes={"maximum_items_per_page"=50}
224
+ * )
225
+ */
226
+ class Book
227
+ {
228
+ // ...
229
+ }
230
+ ` ` `
231
+
232
+ # ## For a Specific Resource Collection Operation
233
+
234
+ ` ` ` php
235
+ <?php
236
+ // src/AppBundle/Entity/Book.php
237
+
238
+ use ApiPlatform\C ore\A nnotation\A piResource;
239
+
240
+ /**
241
+ * @ApiResource(
242
+ * collectionOperations={
243
+ * "get"={"maximum_items_per_page"=50}
244
+ * }
245
+ * )
246
+ */
247
+ class Book
248
+ {
249
+ // ...
250
+ }
251
+ ` ` `
252
+
199
253
# # Partial Pagination
200
254
201
255
When using the default pagination, a `COUNT` query will be issued against the current requested collection. This may have a
You can’t perform that action at this time.
0 commit comments