summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/Javascript.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php
index 21c9e11bd..b56dd9888 100644
--- a/system/libraries/Javascript.php
+++ b/system/libraries/Javascript.php
@@ -723,7 +723,14 @@ class CI_Javascript {
{
if (is_object($result))
{
- $json_result = (array)$result;
+ if (is_callable( array( $result, "result_array" ) ))
+ {
+ $json_result = $result->result_array();
+ }
+ else
+ {
+ $json_result = (array)$result;
+ }
}
elseif (is_array($result))
{