-
-
Save jotham/4c59bd0e95ef5a52eebc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
class CampaignManager_API extends APIController { | |
... | |
public function getClients(){ | |
return $this->success(array( | |
'ClientList' => array() | |
)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
class APIController extends Controller { | |
... | |
public function success($data){ | |
$response = new SS_HTTPResponse(); | |
$response->addHeader('Content-Type', 'application/json'); | |
$response->setBody(json_encode(array( | |
'success' => true, | |
'response' => $data | |
))); | |
return $response; | |
} | |
... | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment