Skip to content

Commit d724e5a

Browse files
mdavid-devdavid.merle
andauthored
docs: clarify pagination_client_enabled configuration (#2237)
Co-authored-by: david.merle <david.merle@cbainfo.fr>
1 parent f1c33c3 commit d724e5a

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

core/pagination.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,21 +191,23 @@ resources:
191191

192192
</code-selector>
193193

194-
### Disabling the Pagination Client-side
194+
### Allowing the Client to Control Pagination
195195

196-
#### Disabling the Pagination Client-side Globally
196+
By default, clients cannot enable or disable pagination via query parameters
197+
(`pagination_client_enabled` defaults to `false`). You can allow clients to control pagination by
198+
setting this option to `true`.
197199

198-
You can configure API Platform to let the client enable or disable the pagination.
200+
#### Allowing the Client to Control Pagination Globally
199201

200-
##### Disabling the Pagination Client-side Globally with Symfony
202+
##### Allowing the Client to Control Pagination Globally with Symfony
201203

202-
To configure this feature globally, use the following configuration:
204+
To enable this feature globally, use the following configuration:
203205

204206
```yaml
205207
# api/config/packages/api_platform.yaml
206208
api_platform:
207209
defaults:
208-
pagination_client_enabled: false
210+
pagination_client_enabled: true
209211
collection:
210212
pagination:
211213
enabled_parameter_name: pagination # optional
@@ -220,17 +222,17 @@ Any value accepted by the
220222
[`FILTER_VALIDATE_BOOLEAN`](https://www.php.net/manual/en/filter.filters.validate.php) filter can be
221223
used as the value.
222224

223-
##### Disabling the Pagination Client-side Globally with Laravel
225+
##### Allowing the Client to Control Pagination Globally with Laravel
224226

225-
To configure this feature globally, use the following configuration:
227+
To enable this feature globally, use the following configuration:
226228

227229
```php
228230
<?php
229231
// config/api-platform.php
230232
return [
231233
// ....
232234
'defaults' => [
233-
'pagination_client_enabled' => false,
235+
'pagination_client_enabled' => true,
234236
],
235237
'collection' => [
236238
'pagination' => [
@@ -249,9 +251,9 @@ Any value accepted by the
249251
[`FILTER_VALIDATE_BOOLEAN`](https://www.php.net/manual/en/filter.filters.validate.php) filter can be
250252
used as the value.
251253

252-
#### Disabling the Pagination Client-side For a Specific Resource
254+
#### Allowing the Client to Control Pagination For a Specific Resource
253255

254-
The client ability to disable the pagination can also be set in the resource configuration:
256+
The client ability to control pagination can also be enabled for a specific resource:
255257

256258
```php
257259
<?php

0 commit comments

Comments
 (0)