Returning results in new API endpoint

  • Thread starter Thread starter Orit
  • Start date Start date

Orit

Guest
Member
Hello,
I've added a new API endpoint to an addon we use (Snogs Advanced forms).
It seems to fetch the items (forms) but the api result returns an array of objects sorted alphabetically.
The code for returning the data is:
PHP:

Code:

Code:
return $this->apiResult([
    'forms' => $forms->toApiResults(),
    'pagination' => $this->getPaginationData($forms, $page, $perPage, $total)
]);

The JSON example:

JSON:

Code:

Code:
{
    "posid": 1,
    "z_connectedThread": 0,
    "z_description": "testing...
Read more

Continue reading...
 
Top