Home » Php » php – need to some action on the api response codeigniter

php – need to some action on the api response codeigniter

Posted by: admin February 25, 2020 Leave a comment

Questions:

Hello I have build application using codeigniter,

where i create one folder inside controllers like api.

it has few files like api/controller.php, api/user.php

i echo json from the all api controllers.

now i have to do some change with the json which is pass to api from one place.

it is not feasible to got to every controller and each function to so this change.

is there is any way like from any core file or anything where i can do code and it will be proceed before the api receive the output.

rg.

Get Attendee API :
current response : {success:true,attendeeList:{list of attendees}}

now i have to change every reponse like
{succss:true,data:{success:true,attendeeList:{list of attendees}} }

How to&Answers:

Hello I Have solved this by using $hook[‘display_override’];
enter image description here