Skip to content

Instantly share code, notes, and snippets.

@philsturgeon
Created July 29, 2010 08:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philsturgeon/497631 to your computer and use it in GitHub Desktop.
Save philsturgeon/497631 to your computer and use it in GitHub Desktop.
Controller_Api
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Api extends Controller {
/**
* Handle a response from an api
*/
public function response($status = 'success', $data = array())
{
$data = array_merge(array('status' => $status), $data);
$this->request->response = json_encode($data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment