diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-19 00:36:19 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-19 00:36:19 -0800 |
commit | eea936877725b9d682dc9969d0904b886c095420 (patch) | |
tree | de575088e4ef55ad9b8ca96aaf80f6ba9fc185ce | |
parent | 2c0b0aaebca6ec1149585853d7d849d50bea4184 (diff) |
Have the rest calls return an array and print it out in the
controller. This is a clearer workflow; controllers generate output,
not helpers. It's also easier to test.
-rw-r--r-- | modules/rest/controllers/rest.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php index cac49740..a3e7313c 100644 --- a/modules/rest/controllers/rest.php +++ b/modules/rest/controllers/rest.php @@ -73,7 +73,7 @@ class Rest_Controller extends Controller { } try { - print call_user_func(array($handler_class, $handler_method), $request); + print rest::reply(call_user_func(array($handler_class, $handler_method), $request)); } catch (ORM_Validation_Exception $e) { foreach ($e->validation->errors() as $key => $value) { $msgs[] = "$key: $value"; |