Created
July 29, 2010 08:38
-
-
Save philsturgeon/497631 to your computer and use it in GitHub Desktop.
Controller_Api
This file contains hidden or 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 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