From eea936877725b9d682dc9969d0904b886c095420 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 19 Jan 2010 00:36:19 -0800 Subject: 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. --- modules/rest/controllers/rest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/rest/controllers/rest.php') 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"; -- cgit v1.2.3