Skip to content

Commit 05906bb

Browse files
committed
docs(app): Fixing docs error and adding changelog
1 parent fb3ee8b commit 05906bb

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

user_guide_src/source/changelogs/v4.7.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Libraries
8181
- **Email:** Added support for choosing the SMTP authorization method. You can change it via ``Config\Email::$SMTPAuthMethod`` option.
8282
- **Image:** The ``ImageMagickHandler`` has been rewritten to rely solely on the PHP ``imagick`` extension.
8383
- **Image:** Added ``ImageMagickHandler::clearMetadata()`` method to remove image metadata for privacy protection.
84+
- **ResponseTrait:** Added ``paginate``` method to simplify paginated API responses. See :ref:`ResponseTrait::paginate() <incoming/api_response_trait_paginate>` for details.
8485
- **Time:** added methods ``Time::addCalendarMonths()`` and ``Time::subCalendarMonths()``
8586

8687
Commands

user_guide_src/source/outgoing/api_responses.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -268,35 +268,35 @@ Example Usage
268268

269269
A typical response might look like:
270270

271-
```json
272-
{
273-
"data": [
274-
{
275-
"id": 1,
276-
"username": "admin",
277-
"email": "[email protected]"
271+
.. code-block:: json
272+
273+
{
274+
"data": [
275+
{
276+
"id": 1,
277+
"username": "admin",
278+
"email": "[email protected]"
279+
},
280+
{
281+
"id": 2,
282+
"username": "user",
283+
"email": "[email protected]"
284+
}
285+
],
286+
"meta": {
287+
"page": 1,
288+
"perPage": 20,
289+
"total": 2,
290+
"totalPages": 1
278291
},
279-
{
280-
"id": 2,
281-
"username": "user",
282-
"email": "[email protected]"
292+
"links": {
293+
"self": "http://example.com/users?page=1",
294+
"first": "http://example.com/users?page=1",
295+
"last": "http://example.com/users?page=1",
296+
"next": null,
297+
"previous": null
283298
}
284-
],
285-
"meta": {
286-
"page": 1,
287-
"perPage": 20,
288-
"total": 2,
289-
"totalPages": 1
290-
},
291-
"links": {
292-
"self": "http://example.com/users?page=1",
293-
"first": "http://example.com/users?page=1",
294-
"last": "http://example.com/users?page=1",
295-
"next": null,
296-
"previous": null
297299
}
298-
}
299-
```
300300
301301
The ``paginate()`` method will always wrap the results in a ``data`` element, and will also include ``meta``
302302
and ``links`` elements to help the client page through the results. If there are no results, the ``data`` element will

0 commit comments

Comments
 (0)